diff options
author | Rui Ueyama <ruiu@google.com> | 2017-10-10 04:53:14 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2017-10-10 04:53:14 +0000 |
commit | c04a91aa39b302d37cc01d222adcaefc770e78bf (patch) | |
tree | 7492a31c25608b07b3f100f01ff3a332b93de541 /lld/ELF/InputSection.cpp | |
parent | ce135ff6f388ac0239025bedc0f2729908c19b49 (diff) | |
download | bcm5719-llvm-c04a91aa39b302d37cc01d222adcaefc770e78bf.tar.gz bcm5719-llvm-c04a91aa39b302d37cc01d222adcaefc770e78bf.zip |
Make a local variable name shorter. NFC.
llvm-svn: 315271
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r-- | lld/ELF/InputSection.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 52f58dec4f1..d71019c1bf8 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -386,7 +386,8 @@ InputSectionBase *InputSection::getRelocatedSection() { // for each relocation. So we copy relocations one by one. template <class ELFT, class RelTy> void InputSection::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) { - InputSectionBase *RelocatedSection = getRelocatedSection(); + InputSectionBase *Sec = getRelocatedSection(); + for (const RelTy &Rel : Rels) { uint32_t Type = Rel.getType(Config->IsMips64EL); SymbolBody &Body = this->getFile<ELFT>()->getRelocTargetSym(Rel); @@ -399,8 +400,7 @@ void InputSection::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) { // Output section VA is zero for -r, so r_offset is an offset within the // section, but for --emit-relocs it is an virtual address. - P->r_offset = RelocatedSection->getOutputSection()->Addr + - RelocatedSection->getOffset(Rel.r_offset); + P->r_offset = Sec->getOutputSection()->Addr + Sec->getOffset(Rel.r_offset); P->setSymbolAndType(InX::SymTab->getSymbolIndex(&Body), Type, Config->IsMips64EL); @@ -423,10 +423,10 @@ void InputSection::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) { if (Config->IsRela) { P->r_addend += Body.getVA() - Section->getOutputSection()->Addr; } else if (Config->Relocatable) { - const uint8_t *BufLoc = RelocatedSection->Data.begin() + Rel.r_offset; - RelocatedSection->Relocations.push_back( - {R_ABS, Type, Rel.r_offset, Target->getImplicitAddend(BufLoc, Type), - &Body}); + const uint8_t *BufLoc = Sec->Data.begin() + Rel.r_offset; + Sec->Relocations.push_back({R_ABS, Type, Rel.r_offset, + Target->getImplicitAddend(BufLoc, Type), + &Body}); } } |