summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/LinkerScript.cpp4
-rw-r--r--lld/ELF/MapFile.cpp2
-rw-r--r--lld/ELF/OutputSections.cpp4
-rw-r--r--lld/ELF/OutputSections.h8
-rw-r--r--lld/ELF/Writer.cpp6
5 files changed, 12 insertions, 12 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 2da59e850b8..6f93859f744 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -449,7 +449,7 @@ template <class ELFT> void LinkerScript<ELFT>::switchTo(OutputSection *Sec) {
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")
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp
index 07e1fa39115..97b913705ca 100644
--- a/lld/ELF/MapFile.cpp
+++ b/lld/ELF/MapFile.cpp
@@ -102,7 +102,7 @@ static void writeMapFile2(raw_fd_ostream &OS,
<< " 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 = "";
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 60b37dd450f..b291635e4e3 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -53,7 +53,7 @@ uint32_t OutputSection::getPhdrFlags() const {
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(typename ELFT::Shdr *Shdr) {
}
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) {
diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h
index b35476cc6db..6aecce7ae3e 100644
--- a/lld/ELF/OutputSections.h
+++ b/lld/ELF/OutputSections.h
@@ -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;
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index b0e6c41b6c9..1b9039d2941 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -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>::assignAddresses() {
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 Off, OutputSection *Sec) {
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.
OpenPOWER on IntegriCloud