[lld] r297144 - Rename Addralign to Alignment.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 06:55:52 PST 2017


Author: rafael
Date: Tue Mar  7 08:55:52 2017
New Revision: 297144

URL: http://llvm.org/viewvc/llvm-project?rev=297144&view=rev
Log:
Rename Addralign to Alignment.

It now matches the name used in InputSectionBase.

Modified:
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/MapFile.cpp
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/ELF/OutputSections.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=297144&r1=297143&r2=297144&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Mar  7 08:55:52 2017
@@ -449,7 +449,7 @@ template <class ELFT> void LinkerScript<
 
   CurOutSec = Sec;
 
-  Dot = alignTo(Dot, CurOutSec->Addralign);
+  Dot = alignTo(Dot, CurOutSec->Alignment);
   CurOutSec->Addr = isTbss<ELFT>(CurOutSec) ? Dot + ThreadBssOffset : Dot;
 
   // If neither AT nor AT> is specified for an allocatable section, the linker
@@ -1862,7 +1862,7 @@ Expr ScriptParser::readPrimary() {
   if (Tok == "ALIGNOF") {
     StringRef Name = readParenLiteral();
     return [=](uint64_t Dot) {
-      return ScriptBase->getOutputSection(Location, Name)->Addralign;
+      return ScriptBase->getOutputSection(Location, Name)->Alignment;
     };
   }
   if (Tok == "SIZEOF_HEADERS")

Modified: lld/trunk/ELF/MapFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MapFile.cpp?rev=297144&r1=297143&r2=297144&view=diff
==============================================================================
--- lld/trunk/ELF/MapFile.cpp (original)
+++ lld/trunk/ELF/MapFile.cpp Tue Mar  7 08:55:52 2017
@@ -102,7 +102,7 @@ static void writeMapFile2(raw_fd_ostream
      << " Align Out     In      File    Symbol\n";
 
   for (OutputSection *Sec : OutputSections) {
-    writeOutSecLine(OS, Width, Sec->Addr, Sec->Size, Sec->Addralign, Sec->Name);
+    writeOutSecLine(OS, Width, Sec->Addr, Sec->Size, Sec->Alignment, Sec->Name);
     OS << '\n';
 
     StringRef PrevName = "";

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=297144&r1=297143&r2=297144&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Mar  7 08:55:52 2017
@@ -53,7 +53,7 @@ uint32_t OutputSection::getPhdrFlags() c
 template <class ELFT>
 void OutputSection::writeHeaderTo(typename ELFT::Shdr *Shdr) {
   Shdr->sh_entsize = Entsize;
-  Shdr->sh_addralign = Addralign;
+  Shdr->sh_addralign = Alignment;
   Shdr->sh_type = Type;
   Shdr->sh_offset = Offset;
   Shdr->sh_flags = Flags;
@@ -65,7 +65,7 @@ void OutputSection::writeHeaderTo(typena
 }
 
 OutputSection::OutputSection(StringRef Name, uint32_t Type, uint64_t Flags)
-    : Name(Name), Addralign(1), Flags(Flags), Type(Type) {}
+    : Name(Name), Alignment(1), Flags(Flags), Type(Type) {}
 
 template <typename ELFT>
 static bool compareByFilePosition(InputSection *A, InputSection *B) {

Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=297144&r1=297143&r2=297144&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Tue Mar  7 08:55:52 2017
@@ -48,9 +48,9 @@ public:
 
   uint32_t getPhdrFlags() const;
 
-  void updateAlignment(uint64_t Alignment) {
-    if (Alignment > Addralign)
-      Addralign = Alignment;
+  void updateAlignment(uint64_t Val) {
+    if (Val > Alignment)
+      Alignment = Val;
   }
 
   // If true, this section will be page aligned on disk.
@@ -70,7 +70,7 @@ public:
   // The following fields correspond to Elf_Shdr members.
   uint64_t Size = 0;
   uint64_t Entsize = 0;
-  uint64_t Addralign = 0;
+  uint64_t Alignment = 0;
   uint64_t Offset = 0;
   uint64_t Flags = 0;
   uint64_t LMAOffset = 0;

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=297144&r1=297143&r2=297144&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Mar  7 08:55:52 2017
@@ -728,7 +728,7 @@ void PhdrEntry::add(OutputSection *Sec)
   Last = Sec;
   if (!First)
     First = Sec;
-  p_align = std::max(p_align, Sec->Addralign);
+  p_align = std::max(p_align, Sec->Alignment);
   if (p_type == PT_LOAD)
     Sec->FirstInPtLoad = First;
 }
@@ -1454,7 +1454,7 @@ template <class ELFT> void Writer<ELFT>:
     VA += getHeaderSize<ELFT>();
   uintX_t ThreadBssOffset = 0;
   for (OutputSection *Sec : OutputSections) {
-    uintX_t Alignment = Sec->Addralign;
+    uintX_t Alignment = Sec->Alignment;
     if (Sec->PageAlign)
       Alignment = std::max<uintX_t>(Alignment, Config->MaxPageSize);
 
@@ -1485,7 +1485,7 @@ static uintX_t getFileAlignment(uintX_t
   OutputSection *First = Sec->FirstInPtLoad;
   // If the section is not in a PT_LOAD, we just have to align it.
   if (!First)
-    return alignTo(Off, Sec->Addralign);
+    return alignTo(Off, Sec->Alignment);
 
   // The first section in a PT_LOAD has to have congruent offset and address
   // module the page size.




More information about the llvm-commits mailing list