@@ -1600,7 +1600,7 @@ uint32_t DynamicReloc::getSymIndex(SymbolTableBaseSection *symTab) const {
16001600 if (!needsDynSymIndex ())
16011601 return 0 ;
16021602
1603- size_t index = symTab->getSymbolIndex (sym);
1603+ size_t index = symTab->getSymbolIndex (* sym);
16041604 assert ((index != 0 || (type != target->gotRel && type != target->pltRel ) ||
16051605 !mainPart->dynSymTab ->getParent ()) &&
16061606 " GOT or PLT relocation must refer to symbol in dynamic symbol table" );
@@ -2172,9 +2172,9 @@ void SymbolTableBaseSection::addSymbol(Symbol *b) {
21722172 symbols.push_back ({b, strTabSec.addString (b->getName (), false )});
21732173}
21742174
2175- size_t SymbolTableBaseSection::getSymbolIndex (Symbol * sym) {
2175+ size_t SymbolTableBaseSection::getSymbolIndex (const Symbol & sym) {
21762176 if (this == mainPart->dynSymTab .get ())
2177- return sym-> dynsymIndex ;
2177+ return sym. dynsymIndex ;
21782178
21792179 // Initializes symbol lookup tables lazily. This is used only for -r,
21802180 // --emit-relocs and dynsyms in partitions other than the main one.
@@ -2191,9 +2191,9 @@ size_t SymbolTableBaseSection::getSymbolIndex(Symbol *sym) {
21912191
21922192 // Section symbols are mapped based on their output sections
21932193 // to maintain their semantics.
2194- if (sym-> type == STT_SECTION)
2195- return sectionIndexMap.lookup (sym-> getOutputSection ());
2196- return symbolIndexMap.lookup (sym);
2194+ if (sym. type == STT_SECTION)
2195+ return sectionIndexMap.lookup (sym. getOutputSection ());
2196+ return symbolIndexMap.lookup (& sym);
21972197}
21982198
21992199template <class ELFT >
@@ -2427,7 +2427,7 @@ void GnuHashTableSection::writeTo(uint8_t *buf) {
24272427 // Write a hash bucket. Hash buckets contain indices in the following hash
24282428 // value table.
24292429 write32 (buckets + i->bucketIdx ,
2430- getPartition ().dynSymTab ->getSymbolIndex (i->sym ));
2430+ getPartition ().dynSymTab ->getSymbolIndex (* i->sym ));
24312431 oldBucket = i->bucketIdx ;
24322432 }
24332433}
0 commit comments