Remove another use of section names. NFC.
llvm-svn: 302671
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index e416c8d..60169b5 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -1004,7 +1004,7 @@
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 @@
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;