@@ -386,7 +386,8 @@ InputSectionBase *InputSection::getRelocatedSection() {
386386// for each relocation. So we copy relocations one by one.
387387template <class ELFT , class RelTy >
388388void InputSection::copyRelocations (uint8_t *Buf, ArrayRef<RelTy> Rels) {
389- InputSectionBase *RelocatedSection = getRelocatedSection ();
389+ InputSectionBase *Sec = getRelocatedSection ();
390+
390391 for (const RelTy &Rel : Rels) {
391392 uint32_t Type = Rel.getType (Config->IsMips64EL );
392393 SymbolBody &Body = this ->getFile <ELFT>()->getRelocTargetSym (Rel);
@@ -399,8 +400,7 @@ void InputSection::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) {
399400
400401 // Output section VA is zero for -r, so r_offset is an offset within the
401402 // section, but for --emit-relocs it is an virtual address.
402- P->r_offset = RelocatedSection->getOutputSection ()->Addr +
403- RelocatedSection->getOffset (Rel.r_offset );
403+ P->r_offset = Sec->getOutputSection ()->Addr + Sec->getOffset (Rel.r_offset );
404404 P->setSymbolAndType (InX::SymTab->getSymbolIndex (&Body), Type,
405405 Config->IsMips64EL );
406406
@@ -423,10 +423,10 @@ void InputSection::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) {
423423 if (Config->IsRela ) {
424424 P->r_addend += Body.getVA () - Section->getOutputSection ()->Addr ;
425425 } else if (Config->Relocatable ) {
426- const uint8_t *BufLoc = RelocatedSection ->Data .begin () + Rel.r_offset ;
427- RelocatedSection ->Relocations .push_back (
428- {R_ABS, Type, Rel. r_offset , Target->getImplicitAddend (BufLoc, Type),
429- &Body});
426+ const uint8_t *BufLoc = Sec ->Data .begin () + Rel.r_offset ;
427+ Sec ->Relocations .push_back ({R_ABS, Type, Rel. r_offset ,
428+ Target->getImplicitAddend (BufLoc, Type),
429+ &Body});
430430 }
431431 }
432432
0 commit comments