Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
lld/ELF/InputFiles.cpp
Show First 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | case SHT_NULL: | ||||
break; | break; | ||||
default: | default: | ||||
Sections[I] = createInputSection(Sec, SectionStringTable); | Sections[I] = createInputSection(Sec, SectionStringTable); | ||||
} | } | ||||
// .ARM.exidx sections have a reverse dependency on the InputSection they | // .ARM.exidx sections have a reverse dependency on the InputSection they | ||||
// have a SHF_LINK_ORDER dependency, this is identified by the sh_link. | // have a SHF_LINK_ORDER dependency, this is identified by the sh_link. | ||||
if (Sec.sh_flags & SHF_LINK_ORDER) { | if (Sec.sh_flags & SHF_LINK_ORDER) { | ||||
if (Sec.sh_link >= Sections.size()) | if (Sec.sh_link >= Sections.size()) | ||||
pcc: I think it's fine to have this restriction, but aren't we still crashing on associated sections… | |||||
fatal(toString(this) + ": invalid sh_link index: " + | fatal(toString(this) + ": invalid sh_link index: " + | ||||
Twine(Sec.sh_link)); | Twine(Sec.sh_link)); | ||||
auto *IS = cast<InputSection<ELFT>>(Sections[Sec.sh_link]); | if (uint32_t Link = Sec.sh_link) { | ||||
ruiuUnsubmitted Not Done ReplyInline ActionsDoes this mean that there is a section with SHF_LINK_ORDER bit but with a null sh_link? It seems like a broken object file to me. ruiu: Does this mean that there is a section with SHF_LINK_ORDER bit but with a null sh_link? It… | |||||
IS->DependentSection = Sections[I]; | auto *IS = cast<InputSection<ELFT>>(Sections[Link]); | ||||
IS->DependentSections.push_back(Sections[I]); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
template <class ELFT> | template <class ELFT> | ||||
InputSectionBase<ELFT> * | InputSectionBase<ELFT> * | ||||
elf::ObjectFile<ELFT>::getRelocTarget(const Elf_Shdr &Sec) { | elf::ObjectFile<ELFT>::getRelocTarget(const Elf_Shdr &Sec) { | ||||
uint32_t Idx = Sec.sh_info; | uint32_t Idx = Sec.sh_info; | ||||
▲ Show 20 Lines • Show All 652 Lines • Show Last 20 Lines |
I think it's fine to have this restriction, but aren't we still crashing on associated sections with relocations referring to merge sections?