Index: ELF/InputSection.cpp =================================================================== --- ELF/InputSection.cpp +++ ELF/InputSection.cpp @@ -337,9 +337,9 @@ } template -static typename ELFT::uint getSymVA(uint32_t Type, typename ELFT::uint A, - typename ELFT::uint P, - const SymbolBody &Body, RelExpr Expr) { +static typename ELFT::uint +getRelocTargetVA(uint32_t Type, typename ELFT::uint A, typename ELFT::uint P, + const SymbolBody &Body, RelExpr Expr) { switch (Expr) { case R_HINT: case R_TLSDESC_CALL: @@ -507,7 +507,7 @@ uint64_t SymVA = 0; if (!Sym.isTls() || Out::TlsPhdr) SymVA = SignExtend64( - getSymVA(Type, Addend, AddrLoc, Sym, R_ABS)); + getRelocTargetVA(Type, Addend, AddrLoc, Sym, R_ABS)); Target->relocateOne(BufLoc, Type, SymVA); } } @@ -535,29 +535,29 @@ uintX_t AddrLoc = OutSec->Addr + Offset; RelExpr Expr = Rel.Expr; - uint64_t SymVA = - SignExtend64(getSymVA(Type, A, AddrLoc, *Rel.Sym, Expr)); + uint64_t TargetVA = SignExtend64( + getRelocTargetVA(Type, A, AddrLoc, *Rel.Sym, Expr)); switch (Expr) { case R_RELAX_GOT_PC: case R_RELAX_GOT_PC_NOPIC: - Target->relaxGot(BufLoc, SymVA); + Target->relaxGot(BufLoc, TargetVA); break; case R_RELAX_TLS_IE_TO_LE: - Target->relaxTlsIeToLe(BufLoc, Type, SymVA); + Target->relaxTlsIeToLe(BufLoc, Type, TargetVA); break; case R_RELAX_TLS_LD_TO_LE: - Target->relaxTlsLdToLe(BufLoc, Type, SymVA); + Target->relaxTlsLdToLe(BufLoc, Type, TargetVA); break; case R_RELAX_TLS_GD_TO_LE: case R_RELAX_TLS_GD_TO_LE_NEG: - Target->relaxTlsGdToLe(BufLoc, Type, SymVA); + Target->relaxTlsGdToLe(BufLoc, Type, TargetVA); break; case R_RELAX_TLS_GD_TO_IE: case R_RELAX_TLS_GD_TO_IE_ABS: case R_RELAX_TLS_GD_TO_IE_PAGE_PC: case R_RELAX_TLS_GD_TO_IE_END: - Target->relaxTlsGdToIe(BufLoc, Type, SymVA); + Target->relaxTlsGdToIe(BufLoc, Type, TargetVA); break; case R_PPC_PLT_OPD: // Patch a nop (0x60000000) to a ld. @@ -565,7 +565,7 @@ write32be(BufLoc + 4, 0xe8410028); // ld %r2, 40(%r1) // fallthrough default: - Target->relocateOne(BufLoc, Type, SymVA); + Target->relocateOne(BufLoc, Type, TargetVA); break; } }