diff options
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 6 | ||||
-rw-r--r-- | lld/ELF/LinkerScript.h | 4 | ||||
-rw-r--r-- | lld/ELF/OutputSections.h | 1 | ||||
-rw-r--r-- | lld/ELF/Writer.cpp | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 579f2f8cfa8..62419734ffc 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -114,8 +114,8 @@ void LinkerScript::setDot(Expr E, const Twine &Loc, bool InSec) { CurAddressState->OutSec->Size = Dot - CurAddressState->OutSec->Addr; } -// This function is called from processCommands, while we are -// fixing the output section layout. +// This function is called from processSectionCommands, +// while we are fixing the output section layout. void LinkerScript::addSymbol(SymbolAssignment *Cmd) { if (Cmd->Name == ".") return; @@ -337,7 +337,7 @@ LinkerScript::createInputSectionList(OutputSection &OutCmd) { return Ret; } -void LinkerScript::processCommands(OutputSectionFactory &Factory) { +void LinkerScript::processSectionCommands(OutputSectionFactory &Factory) { // A symbol can be assigned before any section is mentioned in the linker // script. In an DSO, the symbol values are addresses, so the only important // section values are: diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h index aec93050f88..a4482268575 100644 --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -186,7 +186,7 @@ struct PhdrsCommand { }; class LinkerScript final { - // Temporary state used in processCommands() and assignAddresses() + // Temporary state used in processSectionCommands() and assignAddresses() // that must be reinitialized for each call to the above functions, and must // not be used outside of the scope of a call to the above functions. struct AddressState { @@ -247,7 +247,7 @@ public: void assignAddresses(); void allocateHeaders(std::vector<PhdrEntry *> &Phdrs); void addSymbol(SymbolAssignment *Cmd); - void processCommands(OutputSectionFactory &Factory); + void processSectionCommands(OutputSectionFactory &Factory); // SECTIONS command list. std::vector<BaseCommand *> SectionCommands; diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index f4889f7b94f..cce30f632d9 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -46,6 +46,7 @@ public: static bool classof(const SectionBase *S) { return S->kind() == SectionBase::Output; } + static bool classof(const BaseCommand *C); uint64_t getLMA() const { return Addr + LMAOffset; } diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 99a7029331f..e7e880d0702 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -163,7 +163,7 @@ template <class ELFT> void Writer<ELFT>::run() { // Create output sections. if (Script->HasSectionsCommand) { // If linker script contains SECTIONS commands, let it create sections. - Script->processCommands(Factory); + Script->processSectionCommands(Factory); // Linker scripts may have left some input sections unassigned. // Assign such sections using the default rule. @@ -173,7 +173,7 @@ template <class ELFT> void Writer<ELFT>::run() { // output sections by default rules. We still need to give the // linker script a chance to run, because it might contain // non-SECTIONS commands such as ASSERT. - Script->processCommands(Factory); + Script->processSectionCommands(Factory); createSections(); } |