[lld] r298001 - Revert r297850: [ELF] - Linkerscript: make Dot public and remove getDot(). NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 14:50:31 PDT 2017


Author: ruiu
Date: Thu Mar 16 16:50:30 2017
New Revision: 298001

URL: http://llvm.org/viewvc/llvm-project?rev=298001&view=rev
Log:
Revert r297850: [ELF] - Linkerscript: make Dot public and remove getDot(). NFC.

This reverts commit r297850 because this change was made
based on a miscommunication.

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

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=298001&r1=298000&r2=298001&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Mar 16 16:50:30 2017
@@ -1424,7 +1424,7 @@ Expr ScriptParser::readAssert() {
   return [=] {
     if (!E())
       error(Msg);
-    return ScriptBase->Dot;
+    return ScriptBase->getDot();
   };
 }
 
@@ -1754,7 +1754,7 @@ Expr ScriptParser::readPrimary() {
       return [=] { return alignTo(E(), E2()); };
     }
     expect(")");
-    return [=] { return alignTo(ScriptBase->Dot, E()); };
+    return [=] { return alignTo(ScriptBase->getDot(), E()); };
   }
   if (Tok == "CONSTANT") {
     StringRef Name = readParenLiteral();
@@ -1778,13 +1778,13 @@ Expr ScriptParser::readPrimary() {
     expect(",");
     readExpr();
     expect(")");
-    return [=] { return alignTo(ScriptBase->Dot, E()); };
+    return [=] { return alignTo(ScriptBase->getDot(), E()); };
   }
   if (Tok == "DATA_SEGMENT_END") {
     expect("(");
     expect(".");
     expect(")");
-    return []() { return ScriptBase->Dot; };
+    return []() { return ScriptBase->getDot(); };
   }
   // GNU linkers implements more complicated logic to handle
   // DATA_SEGMENT_RELRO_END. We instead ignore the arguments and just align to
@@ -1795,7 +1795,7 @@ Expr ScriptParser::readPrimary() {
     expect(",");
     readExpr();
     expect(")");
-    return []() { return alignTo(ScriptBase->Dot, Target->PageSize); };
+    return []() { return alignTo(ScriptBase->getDot(), Target->PageSize); };
   }
   if (Tok == "SIZEOF") {
     StringRef Name = readParenLiteral();

Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=298001&r1=298000&r2=298001&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Thu Mar 16 16:50:30 2017
@@ -252,6 +252,7 @@ protected:
   // "ScriptConfig" is a bit too long, so define a short name for it.
   ScriptConfiguration &Opt = *ScriptConfig;
 
+  uint64_t Dot;
   uint64_t ThreadBssOffset = 0;
 
   std::function<uint64_t()> LMAOffset;
@@ -262,10 +263,8 @@ protected:
   llvm::DenseSet<InputSectionBase *> AlreadyOutputIS;
 
 public:
-  uint64_t Dot;
-  std::vector<OutputSection *> *OutputSections;
-
   bool hasPhdrsCommands() { return !Opt.PhdrsCommands.empty(); }
+  uint64_t getDot() { return Dot; }
   OutputSection *getOutputSection(const Twine &Loc, StringRef S);
   uint64_t getOutputSectionSize(StringRef S);
   void discard(ArrayRef<InputSectionBase *> V);
@@ -275,6 +274,7 @@ public:
   virtual bool isAbsolute(StringRef S) = 0;
   virtual OutputSection *getSymbolSection(StringRef S) = 0;
 
+  std::vector<OutputSection *> *OutputSections;
   void addOrphanSections(OutputSectionFactory &Factory);
   void removeEmptyCommands();
   void adjustSectionsBeforeSorting();




More information about the llvm-commits mailing list