[lld] r281449 - [ELF] Replace HasContents with HasSections. NFC

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 01:32:36 PDT 2016


Author: evgeny777
Date: Wed Sep 14 03:32:36 2016
New Revision: 281449

URL: http://llvm.org/viewvc/llvm-project?rev=281449&view=rev
Log:
[ELF] Replace HasContents with HasSections. NFC

Modified:
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/LinkerScript.h
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=281449&r1=281448&r2=281449&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Wed Sep 14 03:32:36 2016
@@ -762,7 +762,7 @@ void ScriptParser::readLinkerScript() {
     } else if (Tok == "VERSION") {
       readVersion();
     } else if (SymbolAssignment *Cmd = readProvideOrAssignment(Tok, true)) {
-      if (Opt.HasContents)
+      if (Opt.HasSections)
         Opt.Commands.emplace_back(Cmd);
       else
         Opt.Assignments.emplace_back(Cmd);
@@ -923,7 +923,7 @@ void ScriptParser::readSearchDir() {
 }
 
 void ScriptParser::readSections() {
-  Opt.HasContents = true;
+  Opt.HasSections = true;
   expect("{");
   while (!Error && !skip("}")) {
     StringRef Tok = next();

Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=281449&r1=281448&r2=281449&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Wed Sep 14 03:32:36 2016
@@ -146,7 +146,7 @@ struct ScriptConfiguration {
   // Used to assign sections to headers.
   std::vector<PhdrsCommand> PhdrsCommands;
 
-  bool HasContents = false;
+  bool HasSections = false;
 
   llvm::BumpPtrAllocator Alloc;
 

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=281449&r1=281448&r2=281449&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed Sep 14 03:32:36 2016
@@ -252,7 +252,7 @@ template <class ELFT> void Writer<ELFT>:
   Script<ELFT>::X->createAssignments();
 
   Script<ELFT>::X->OutputSections = &OutputSections;
-  if (ScriptConfig->HasContents)
+  if (ScriptConfig->HasSections)
     Script<ELFT>::X->createSections(Factory);
   else
     createSections();
@@ -267,7 +267,7 @@ template <class ELFT> void Writer<ELFT>:
     Phdrs = Script<ELFT>::X->hasPhdrsCommands() ? Script<ELFT>::X->createPhdrs()
                                                 : createPhdrs();
     fixHeaders();
-    if (ScriptConfig->HasContents) {
+    if (ScriptConfig->HasSections) {
       Script<ELFT>::X->assignAddresses();
     } else {
       fixSectionAlignments();
@@ -610,7 +610,7 @@ template <class ELFT> void Writer<ELFT>:
     Symtab<ELFT>::X->addIgnored("__tls_get_addr");
 
   // If linker script do layout we do not need to create any standart symbols.
-  if (ScriptConfig->HasContents)
+  if (ScriptConfig->HasSections)
     return;
 
   ElfSym<ELFT>::EhdrStart = Symtab<ELFT>::X->addIgnored("__ehdr_start");
@@ -1060,7 +1060,7 @@ template <class ELFT> void Writer<ELFT>:
 // sections. These are special, we do not include them into output sections
 // list, but have them to simplify the code.
 template <class ELFT> void Writer<ELFT>::fixHeaders() {
-  uintX_t BaseVA = ScriptConfig->HasContents ? 0 : Config->ImageBase;
+  uintX_t BaseVA = ScriptConfig->HasSections ? 0 : Config->ImageBase;
   Out<ELFT>::ElfHeader->setVA(BaseVA);
   uintX_t Off = Out<ELFT>::ElfHeader->getSize();
   Out<ELFT>::ProgramHeaders->setVA(Off + BaseVA);




More information about the llvm-commits mailing list