[lld] r256844 - Consistently use 'Bss' instead of 'BSS'.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 5 08:35:44 PST 2016
Author: ruiu
Date: Tue Jan 5 10:35:43 2016
New Revision: 256844
URL: http://llvm.org/viewvc/llvm-project?rev=256844&view=rev
Log:
Consistently use 'Bss' instead of 'BSS'.
Modified:
lld/trunk/ELF/OutputSections.cpp
lld/trunk/ELF/Symbols.h
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=256844&r1=256843&r2=256844&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Jan 5 10:35:43 2016
@@ -289,7 +289,7 @@ template <class ELFT> void RelocationSec
P->r_offset = Out<ELFT>::Got->getEntryAddr(*Body);
else if (NeedsCopy)
P->r_offset = Out<ELFT>::Bss->getVA() +
- dyn_cast<SharedSymbol<ELFT>>(Body)->OffsetInBSS;
+ dyn_cast<SharedSymbol<ELFT>>(Body)->OffsetInBss;
else
P->r_offset = C.getOffset(RI.r_offset) + C.OutSec->getVA();
@@ -799,11 +799,11 @@ typename ELFFile<ELFT>::uintX_t lld::elf
return SC->OutSec->getVA() + SC->getOffset(DR.Sym);
}
case SymbolBody::DefinedCommonKind:
- return Out<ELFT>::Bss->getVA() + cast<DefinedCommon>(S).OffsetInBSS;
+ return Out<ELFT>::Bss->getVA() + cast<DefinedCommon>(S).OffsetInBss;
case SymbolBody::SharedKind: {
auto &SS = cast<SharedSymbol<ELFT>>(S);
if (SS.NeedsCopy)
- return Out<ELFT>::Bss->getVA() + SS.OffsetInBSS;
+ return Out<ELFT>::Bss->getVA() + SS.OffsetInBss;
return 0;
}
case SymbolBody::UndefinedElfKind:
Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=256844&r1=256843&r2=256844&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Tue Jan 5 10:35:43 2016
@@ -173,7 +173,7 @@ public:
// The output offset of this common symbol in the output bss. Computed by the
// writer.
- uint64_t OffsetInBSS;
+ uint64_t OffsetInBss;
// The maximum alignment we have seen for this symbol.
uint64_t MaxAlignment;
@@ -262,9 +262,9 @@ public:
SharedFile<ELFT> *File;
// True if the linker has to generate a copy relocation for this shared
- // symbol. OffsetInBSS is significant only when NeedsCopy is true.
+ // symbol. OffsetInBss is significant only when NeedsCopy is true.
bool NeedsCopy = false;
- uintX_t OffsetInBSS = 0;
+ uintX_t OffsetInBss = 0;
};
// This class represents a symbol defined in an archive file. It is
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=256844&r1=256843&r2=256844&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Jan 5 10:35:43 2016
@@ -69,7 +69,7 @@ private:
}
int getPhdrsNum() const;
- OutputSection<ELFT> *getBSS();
+ OutputSection<ELFT> *getBss();
void addCommonSymbols(std::vector<DefinedCommon *> &Syms);
void addCopyRelSymbols(std::vector<SharedSymbol<ELFT> *> &Syms);
@@ -466,7 +466,7 @@ static bool compareOutputSections(Output
return false;
}
-template <class ELFT> OutputSection<ELFT> *Writer<ELFT>::getBSS() {
+template <class ELFT> OutputSection<ELFT> *Writer<ELFT>::getBss() {
if (!Out<ELFT>::Bss) {
Out<ELFT>::Bss =
new OutputSection<ELFT>(".bss", SHT_NOBITS, SHF_ALLOC | SHF_WRITE);
@@ -489,11 +489,11 @@ void Writer<ELFT>::addCommonSymbols(std:
return A->MaxAlignment > B->MaxAlignment;
});
- uintX_t Off = getBSS()->getSize();
+ uintX_t Off = getBss()->getSize();
for (DefinedCommon *C : Syms) {
uintX_t Align = C->MaxAlignment;
Off = RoundUpToAlignment(Off, Align);
- C->OffsetInBSS = Off;
+ C->OffsetInBss = Off;
Off += C->Size;
}
@@ -505,7 +505,7 @@ template <class ELFT>
void Writer<ELFT>::addCopyRelSymbols(std::vector<SharedSymbol<ELFT> *> &Syms) {
if (Syms.empty())
return;
- uintX_t Off = getBSS()->getSize();
+ uintX_t Off = getBss()->getSize();
for (SharedSymbol<ELFT> *C : Syms) {
const Elf_Sym &Sym = C->Sym;
const Elf_Shdr *Sec = C->File->getSection(Sym);
@@ -516,7 +516,7 @@ void Writer<ELFT>::addCopyRelSymbols(std
uintX_t Align = 1 << TrailingZeros;
Out<ELFT>::Bss->updateAlign(Align);
Off = RoundUpToAlignment(Off, Align);
- C->OffsetInBSS = Off;
+ C->OffsetInBss = Off;
Off += Sym.st_size;
}
Out<ELFT>::Bss->setSize(Off);
@@ -1014,7 +1014,7 @@ template <class ELFT> void Writer<ELFT>:
Elf_Phdr GnuRelroPhdr = {};
Elf_Phdr TlsPhdr{};
bool RelroAligned = false;
- uintX_t ThreadBSSOffset = 0;
+ uintX_t ThreadBssOffset = 0;
// Create phdrs as we assign VAs and file offsets to all output sections.
for (OutputSectionBase<ELFT> *Sec : OutputSections) {
Elf_Phdr *PH = &Phdrs[PhdrIdx];
@@ -1040,11 +1040,11 @@ template <class ELFT> void Writer<ELFT>:
setPhdr(&TlsPhdr, PT_TLS, PF_R, FileOff, VA, 0, Sec->getAlign());
if (Sec->getType() != SHT_NOBITS)
VA = RoundUpToAlignment(VA, Sec->getAlign());
- uintX_t TVA = RoundUpToAlignment(VA + ThreadBSSOffset, Sec->getAlign());
+ uintX_t TVA = RoundUpToAlignment(VA + ThreadBssOffset, Sec->getAlign());
Sec->setVA(TVA);
TlsPhdr.p_memsz += Sec->getSize();
if (Sec->getType() == SHT_NOBITS) {
- ThreadBSSOffset = TVA - VA + Sec->getSize();
+ ThreadBssOffset = TVA - VA + Sec->getSize();
} else {
TlsPhdr.p_filesz += Sec->getSize();
VA += Sec->getSize();
More information about the llvm-commits
mailing list