Move clearOutputSections before createPhdrs. NFC.
llvm-svn: 305156
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 9dd7ba5..235fa25 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -958,7 +958,8 @@
}
// Creates program headers as instructed by PHDRS linker script command.
-std::vector<PhdrEntry> LinkerScript::createPhdrs() {
+std::vector<PhdrEntry> LinkerScript::createPhdrs(
+ ArrayRef<OutputSectionCommand *> OutputSectionCommands) {
std::vector<PhdrEntry> Ret;
// Process PHDRS and FILEHDR keywords because they are not
@@ -979,7 +980,8 @@
}
// Add output sections to program headers.
- for (OutputSection *Sec : *OutputSections) {
+ for (OutputSectionCommand *Cmd : OutputSectionCommands) {
+ OutputSection *Sec = Cmd->Sec;
if (!(Sec->Flags & SHF_ALLOC))
break;