Changeset View
Changeset View
Standalone View
Standalone View
lld/ELF/LinkerScript.cpp
Show First 20 Lines • Show All 684 Lines • ▼ Show 20 Lines | for (OutputSection *sec : v) { | ||||
if (config->relocatable && (isec->flags & SHF_LINK_ORDER)) { | if (config->relocatable && (isec->flags & SHF_LINK_ORDER)) { | ||||
// Merging two SHF_LINK_ORDER sections with different sh_link fields will | // Merging two SHF_LINK_ORDER sections with different sh_link fields will | ||||
// change their semantics, so we only merge them in -r links if they will | // change their semantics, so we only merge them in -r links if they will | ||||
// end up being linked to the same output section. The casts are fine | // end up being linked to the same output section. The casts are fine | ||||
// because everything in the map was created by the orphan placement code. | // because everything in the map was created by the orphan placement code. | ||||
auto *firstIsec = cast<InputSectionBase>( | auto *firstIsec = cast<InputSectionBase>( | ||||
cast<InputSectionDescription>(sec->sectionCommands[0]) | cast<InputSectionDescription>(sec->sectionCommands[0]) | ||||
->sectionBases[0]); | ->sectionBases[0]); | ||||
if (firstIsec->getLinkOrderDep()->getOutputSection() != | OutputSection *firstIsecOut = | ||||
isec->getLinkOrderDep()->getOutputSection()) | firstIsec->flags & SHF_LINK_ORDER | ||||
? firstIsec->getLinkOrderDep()->getOutputSection() | |||||
: nullptr; | |||||
if (firstIsecOut != isec->getLinkOrderDep()->getOutputSection()) | |||||
grimar: Probably you shouldn't use `auto`, because the return type is not obvious here. | |||||
continue; | continue; | ||||
} | } | ||||
sec->recordSection(isec); | sec->recordSection(isec); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
OutputSection *sec = createSection(isec, outsecName); | OutputSection *sec = createSection(isec, outsecName); | ||||
▲ Show 20 Lines • Show All 575 Lines • Show Last 20 Lines |
Probably you shouldn't use auto, because the return type is not obvious here.