forked from OSchip/llvm-project
ELF: Remove accessors that don't hide anything.
llvm-svn: 255857
This commit is contained in:
parent
61805ec343
commit
a02bba648b
|
@ -221,16 +221,16 @@ bool RelocationSection<ELFT>::applyTlsDynamicReloc(SymbolBody *Body,
|
|||
return false;
|
||||
|
||||
if (Target->isTlsOptimized(Type, Body)) {
|
||||
P->setSymbolAndType(Body->getDynamicSymbolTableIndex(),
|
||||
P->setSymbolAndType(Body->DynamicSymbolTableIndex,
|
||||
Target->getTlsGotReloc(), Config->Mips64EL);
|
||||
P->r_offset = Out<ELFT>::Got->getEntryAddr(*Body);
|
||||
return true;
|
||||
}
|
||||
|
||||
P->setSymbolAndType(Body->getDynamicSymbolTableIndex(),
|
||||
P->setSymbolAndType(Body->DynamicSymbolTableIndex,
|
||||
Target->getTlsModuleIndexReloc(), Config->Mips64EL);
|
||||
P->r_offset = Out<ELFT>::Got->getGlobalDynAddr(*Body);
|
||||
N->setSymbolAndType(Body->getDynamicSymbolTableIndex(),
|
||||
N->setSymbolAndType(Body->DynamicSymbolTableIndex,
|
||||
Target->getTlsOffsetReloc(), Config->Mips64EL);
|
||||
N->r_offset = Out<ELFT>::Got->getGlobalDynAddr(*Body) + sizeof(uintX_t);
|
||||
return true;
|
||||
|
@ -264,7 +264,7 @@ template <class ELFT> void RelocationSection<ELFT>::writeTo(uint8_t *Buf) {
|
|||
bool LazyReloc = Body && Target->supportsLazyRelocations() &&
|
||||
Target->relocNeedsPlt(Type, *Body);
|
||||
|
||||
unsigned Sym = CanBePreempted ? Body->getDynamicSymbolTableIndex() : 0;
|
||||
unsigned Sym = CanBePreempted ? Body->DynamicSymbolTableIndex : 0;
|
||||
unsigned Reloc;
|
||||
if (!CanBePreempted)
|
||||
Reloc = Target->getRelativeReloc();
|
||||
|
@ -383,7 +383,7 @@ template <class ELFT> void HashTableSection<ELFT>::writeTo(uint8_t *Buf) {
|
|||
|
||||
for (SymbolBody *Body : Out<ELFT>::DynSymTab->getSymbols()) {
|
||||
StringRef Name = Body->getName();
|
||||
unsigned I = Body->getDynamicSymbolTableIndex();
|
||||
unsigned I = Body->DynamicSymbolTableIndex;
|
||||
uint32_t Hash = hashSysv(Name) % NumSymbols;
|
||||
Chains[I] = Buckets[Hash];
|
||||
Buckets[Hash] = I;
|
||||
|
@ -496,7 +496,7 @@ void GnuHashTableSection<ELFT>::writeHashTable(uint8_t *Buf) {
|
|||
int Bucket = Item.Hash % NBuckets;
|
||||
assert(PrevBucket <= Bucket);
|
||||
if (Bucket != PrevBucket) {
|
||||
Buckets[Bucket] = Item.Body->getDynamicSymbolTableIndex();
|
||||
Buckets[Bucket] = Item.Body->DynamicSymbolTableIndex;
|
||||
PrevBucket = Bucket;
|
||||
if (I > 0)
|
||||
Values[I - 1] |= 1;
|
||||
|
@ -743,7 +743,7 @@ template <class ELFT> void DynamicSection<ELFT>::writeTo(uint8_t *Buf) {
|
|||
WriteVal(DT_MIPS_SYMTABNO, Out<ELFT>::DynSymTab->getNumSymbols());
|
||||
WriteVal(DT_MIPS_LOCAL_GOTNO, Out<ELFT>::Got->getMipsLocalEntriesNum());
|
||||
if (const SymbolBody *B = Out<ELFT>::Got->getMipsFirstGlobalEntry())
|
||||
WriteVal(DT_MIPS_GOTSYM, B->getDynamicSymbolTableIndex());
|
||||
WriteVal(DT_MIPS_GOTSYM, B->DynamicSymbolTableIndex);
|
||||
else
|
||||
WriteVal(DT_MIPS_GOTSYM, Out<ELFT>::DynSymTab->getNumSymbols());
|
||||
WritePtr(DT_PLTGOT, Out<ELFT>::Got->getVA());
|
||||
|
@ -1237,7 +1237,7 @@ template <class ELFT> void SymbolTableSection<ELFT>::finalize() {
|
|||
std::stable_sort(Symbols.begin(), Symbols.end(), sortMipsSymbols);
|
||||
size_t I = 0;
|
||||
for (SymbolBody *B : Symbols)
|
||||
B->setDynamicSymbolTableIndex(++I);
|
||||
B->DynamicSymbolTableIndex = ++I;
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
|
|
|
@ -84,11 +84,7 @@ public:
|
|||
|
||||
uint8_t getVisibility() const { return Visibility; }
|
||||
|
||||
unsigned getDynamicSymbolTableIndex() const {
|
||||
return DynamicSymbolTableIndex;
|
||||
}
|
||||
void setDynamicSymbolTableIndex(unsigned V) { DynamicSymbolTableIndex = V; }
|
||||
|
||||
unsigned DynamicSymbolTableIndex = 0;
|
||||
uint32_t GlobalDynIndex = -1;
|
||||
uint32_t GotIndex = -1;
|
||||
uint32_t GotPltIndex = -1;
|
||||
|
@ -127,7 +123,6 @@ protected:
|
|||
unsigned IsUsedInRegularObj : 1;
|
||||
unsigned IsUsedInDynamicReloc : 1;
|
||||
unsigned IsTls : 1;
|
||||
unsigned DynamicSymbolTableIndex = 0;
|
||||
StringRef Name;
|
||||
Symbol *Backref = nullptr;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue