[lld] r259142 - Rename DynamicSymbolTableIndex -> DynsymIndex.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 28 17:49:33 PST 2016
Author: ruiu
Date: Thu Jan 28 19:49:33 2016
New Revision: 259142
URL: http://llvm.org/viewvc/llvm-project?rev=259142&view=rev
Log:
Rename DynamicSymbolTableIndex -> DynsymIndex.
This is the index in .dynsym, so the new name should make sense.
Modified:
lld/trunk/ELF/OutputSections.cpp
lld/trunk/ELF/Symbols.h
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=259142&r1=259141&r2=259142&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Thu Jan 28 19:49:33 2016
@@ -252,16 +252,16 @@ bool RelocationSection<ELFT>::applyTlsDy
return false;
if (Target->canRelaxTls(Type, Body)) {
- P->setSymbolAndType(Body->DynamicSymbolTableIndex, Target->getTlsGotRel(),
+ P->setSymbolAndType(Body->DynsymIndex, Target->getTlsGotRel(),
Config->Mips64EL);
P->r_offset = Out<ELFT>::Got->getEntryAddr(*Body);
return true;
}
- P->setSymbolAndType(Body->DynamicSymbolTableIndex, Target->TlsModuleIndexRel,
+ P->setSymbolAndType(Body->DynsymIndex, Target->TlsModuleIndexRel,
Config->Mips64EL);
P->r_offset = Out<ELFT>::Got->getGlobalDynAddr(*Body);
- N->setSymbolAndType(Body->DynamicSymbolTableIndex, Target->TlsOffsetRel,
+ N->setSymbolAndType(Body->DynsymIndex, Target->TlsOffsetRel,
Config->Mips64EL);
N->r_offset = Out<ELFT>::Got->getGlobalDynAddr(*Body) + sizeof(uintX_t);
return true;
@@ -300,8 +300,7 @@ template <class ELFT> void RelocationSec
// Emit a copy relocation.
auto *SS = dyn_cast_or_null<SharedSymbol<ELFT>>(Body);
if (SS && SS->NeedsCopy) {
- P->setSymbolAndType(Body->DynamicSymbolTableIndex, Target->CopyRel,
- Config->Mips64EL);
+ P->setSymbolAndType(Body->DynsymIndex, Target->CopyRel, Config->Mips64EL);
P->r_offset = Out<ELFT>::Bss->getVA() + SS->OffsetInBss;
continue;
}
@@ -334,8 +333,7 @@ template <class ELFT> void RelocationSec
Reloc = Body->isTls() ? Target->getTlsGotRel() : Target->GotRel;
else
Reloc = Target->getDynReloc(Type);
- P->setSymbolAndType(CBP ? Body->DynamicSymbolTableIndex : 0, Reloc,
- Config->Mips64EL);
+ P->setSymbolAndType(CBP ? Body->DynsymIndex : 0, Reloc, Config->Mips64EL);
if (LazyReloc)
P->r_offset = Out<ELFT>::GotPlt->getEntryAddr(*Body);
@@ -431,7 +429,7 @@ template <class ELFT> void HashTableSect
Out<ELFT>::DynSymTab->getSymbols()) {
SymbolBody *Body = P.first;
StringRef Name = Body->getName();
- unsigned I = Body->DynamicSymbolTableIndex;
+ unsigned I = Body->DynsymIndex;
uint32_t Hash = hashSysv(Name) % NumSymbols;
Chains[I] = Buckets[Hash];
Buckets[Hash] = I;
@@ -543,7 +541,7 @@ void GnuHashTableSection<ELFT>::writeHas
int Bucket = Item.Hash % NBuckets;
assert(PrevBucket <= Bucket);
if (Bucket != PrevBucket) {
- Buckets[Bucket] = Item.Body->DynamicSymbolTableIndex;
+ Buckets[Bucket] = Item.Body->DynsymIndex;
PrevBucket = Bucket;
if (I > 0)
Values[I - 1] |= 1;
@@ -698,7 +696,7 @@ template <class ELFT> void DynamicSectio
Add({DT_MIPS_SYMTABNO, Out<ELFT>::DynSymTab->getNumSymbols()});
Add({DT_MIPS_LOCAL_GOTNO, Out<ELFT>::Got->getMipsLocalEntriesNum()});
if (const SymbolBody *B = Out<ELFT>::Got->getMipsFirstGlobalEntry())
- Add({DT_MIPS_GOTSYM, B->DynamicSymbolTableIndex});
+ Add({DT_MIPS_GOTSYM, B->DynsymIndex});
else
Add({DT_MIPS_GOTSYM, Out<ELFT>::DynSymTab->getNumSymbols()});
Add({DT_PLTGOT, Out<ELFT>::Got});
@@ -1418,7 +1416,7 @@ template <class ELFT> void SymbolTableSe
std::stable_sort(Symbols.begin(), Symbols.end(), sortMipsSymbols);
size_t I = 0;
for (const std::pair<SymbolBody *, unsigned> &P : Symbols)
- P.first->DynamicSymbolTableIndex = ++I;
+ P.first->DynsymIndex = ++I;
}
template <class ELFT>
Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=259142&r1=259141&r2=259142&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Thu Jan 28 19:49:33 2016
@@ -92,7 +92,7 @@ public:
uint8_t getVisibility() const { return Visibility; }
- unsigned DynamicSymbolTableIndex = 0;
+ unsigned DynsymIndex = 0;
uint32_t GlobalDynIndex = -1;
uint32_t GotIndex = -1;
uint32_t GotPltIndex = -1;
More information about the llvm-commits
mailing list