diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2017-05-10 14:28:31 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2017-05-10 14:28:31 +0000 |
| commit | 2c923c2c3707a2ebff4c2753ecdb09464f6cf5d0 (patch) | |
| tree | 393c1cd83afb168a67528d0d527869742f787429 /lld/ELF/LinkerScript.cpp | |
| parent | 6f4cdb89122d3a2036f17c81e8398bd4bc302e0f (diff) | |
| download | bcm5719-llvm-2c923c2c3707a2ebff4c2753ecdb09464f6cf5d0.tar.gz bcm5719-llvm-2c923c2c3707a2ebff4c2753ecdb09464f6cf5d0.zip | |
Remove another use of section names. NFC.
llvm-svn: 302671
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index e416c8d8419..60169b51b80 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -1004,7 +1004,7 @@ std::vector<PhdrEntry> LinkerScript::createPhdrs() { break; // Assign headers specified by linker script - for (size_t Id : getPhdrIndices(Sec->Name)) { + for (size_t Id : getPhdrIndices(Sec)) { Ret[Id].add(Sec); if (Opt.PhdrsCommands[Id].Flags == UINT_MAX) Ret[Id].p_flags |= Sec->getPhdrFlags(); @@ -1084,13 +1084,12 @@ ExprValue LinkerScript::getSymbolValue(const Twine &Loc, StringRef S) { bool LinkerScript::isDefined(StringRef S) { return findSymbol(S) != nullptr; } -// Returns indices of ELF headers containing specific section, identified -// by Name. Each index is a zero based number of ELF header listed within -// PHDRS {} script block. -std::vector<size_t> LinkerScript::getPhdrIndices(StringRef SectionName) { +// Returns indices of ELF headers containing specific section. Each index is a +// zero based number of ELF header listed within PHDRS {} script block. +std::vector<size_t> LinkerScript::getPhdrIndices(OutputSection *Sec) { for (BaseCommand *Base : Opt.Commands) { auto *Cmd = dyn_cast<OutputSectionCommand>(Base); - if (!Cmd || Cmd->Name != SectionName) + if (!Cmd || Cmd->Sec != Sec) continue; std::vector<size_t> Ret; |

