diff options
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 4 | ||||
-rw-r--r-- | lld/ELF/LinkerScript.h | 2 | ||||
-rw-r--r-- | lld/ELF/OutputSections.cpp | 2 | ||||
-rw-r--r-- | lld/ELF/SyntheticSections.cpp | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index d7858e173c7..78531dbc93e 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -1020,10 +1020,10 @@ bool LinkerScript::ignoreInterpSection() { return true; } -Optional<uint32_t> LinkerScript::getFiller(StringRef Name) { +Optional<uint32_t> LinkerScript::getFiller(OutputSection *Sec) { for (BaseCommand *Base : Opt.Commands) if (auto *Cmd = dyn_cast<OutputSectionCommand>(Base)) - if (Cmd->Name == Name) + if (Cmd->Sec == Sec) return Cmd->Filler; return None; } diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h index 7bcd21c8760..5a464cef849 100644 --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -262,7 +262,7 @@ public: std::vector<PhdrEntry> createPhdrs(); bool ignoreInterpSection(); - llvm::Optional<uint32_t> getFiller(StringRef Name); + llvm::Optional<uint32_t> getFiller(OutputSection *Sec); bool hasLMA(StringRef Name); bool shouldKeep(InputSectionBase *S); void assignOffsets(OutputSectionCommand *Cmd); diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index cb9c57657af..9cbbd468e8f 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -273,7 +273,7 @@ uint32_t OutputSection::getFiller() { // linker script. If nothing is specified and this is an executable section, // fall back to trap instructions to prevent bad diassembly and detect invalid // jumps to padding. - if (Optional<uint32_t> Filler = Script->getFiller(Name)) + if (Optional<uint32_t> Filler = Script->getFiller(this)) return *Filler; if (Flags & SHF_EXECINSTR) return Target->TrapInstr; diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 9c585e41e9f..a813d2f4097 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2187,7 +2187,7 @@ MipsRldMapSection::MipsRldMapSection() void MipsRldMapSection::writeTo(uint8_t *Buf) { // Apply filler from linker script. - Optional<uint32_t> Fill = Script->getFiller(this->Name); + Optional<uint32_t> Fill = Script->getFiller(this->OutSec); if (!Fill || *Fill == 0) return; |