forked from OSchip/llvm-project
parent
43dab5a5fb
commit
23e6a02450
|
@ -518,7 +518,6 @@ template <class ELFT> void LinkerScript<ELFT>::process(BaseCommand &Base) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ELFT>
|
|
||||||
static OutputSection *
|
static OutputSection *
|
||||||
findSection(StringRef Name, const std::vector<OutputSection *> &Sections) {
|
findSection(StringRef Name, const std::vector<OutputSection *> &Sections) {
|
||||||
auto End = Sections.end();
|
auto End = Sections.end();
|
||||||
|
@ -571,7 +570,7 @@ MemoryRegion *LinkerScript<ELFT>::findMemoryRegion(OutputSectionCommand *Cmd,
|
||||||
// for a single sections command (e.g. ".text { *(.text); }").
|
// for a single sections command (e.g. ".text { *(.text); }").
|
||||||
template <class ELFT>
|
template <class ELFT>
|
||||||
void LinkerScript<ELFT>::assignOffsets(OutputSectionCommand *Cmd) {
|
void LinkerScript<ELFT>::assignOffsets(OutputSectionCommand *Cmd) {
|
||||||
OutputSection *Sec = findSection<ELFT>(Cmd->Name, *OutputSections);
|
OutputSection *Sec = findSection(Cmd->Name, *OutputSections);
|
||||||
if (!Sec)
|
if (!Sec)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -618,7 +617,7 @@ template <class ELFT> void LinkerScript<ELFT>::removeEmptyCommands() {
|
||||||
Opt.Commands.begin(), Opt.Commands.end(),
|
Opt.Commands.begin(), Opt.Commands.end(),
|
||||||
[&](const std::unique_ptr<BaseCommand> &Base) {
|
[&](const std::unique_ptr<BaseCommand> &Base) {
|
||||||
if (auto *Cmd = dyn_cast<OutputSectionCommand>(Base.get()))
|
if (auto *Cmd = dyn_cast<OutputSectionCommand>(Base.get()))
|
||||||
return !findSection<ELFT>(Cmd->Name, *OutputSections);
|
return !findSection(Cmd->Name, *OutputSections);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
Opt.Commands.erase(Pos, Opt.Commands.end());
|
Opt.Commands.erase(Pos, Opt.Commands.end());
|
||||||
|
@ -642,7 +641,7 @@ template <class ELFT> void LinkerScript<ELFT>::adjustSectionsBeforeSorting() {
|
||||||
auto *Cmd = dyn_cast<OutputSectionCommand>(Base.get());
|
auto *Cmd = dyn_cast<OutputSectionCommand>(Base.get());
|
||||||
if (!Cmd)
|
if (!Cmd)
|
||||||
continue;
|
continue;
|
||||||
if (OutputSection *Sec = findSection<ELFT>(Cmd->Name, *OutputSections)) {
|
if (OutputSection *Sec = findSection(Cmd->Name, *OutputSections)) {
|
||||||
Flags = Sec->Flags;
|
Flags = Sec->Flags;
|
||||||
Type = Sec->Type;
|
Type = Sec->Type;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue