Rename InputSection.cpp:getSymVA to getRelocTargetVA.
This name was really confusing because there is also another static helper Symbols.cpp:getSymVA which has the same name. llvm-svn: 289733
This commit is contained in:
parent
7cc577a4ef
commit
7608626631
|
@ -337,9 +337,9 @@ static uint64_t getAArch64UndefinedRelativeWeakVA(uint64_t Type, uint64_t A,
|
|||
}
|
||||
|
||||
template <class ELFT>
|
||||
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 @@ void InputSection<ELFT>::relocateNonAlloc(uint8_t *Buf, ArrayRef<RelTy> Rels) {
|
|||
uint64_t SymVA = 0;
|
||||
if (!Sym.isTls() || Out<ELFT>::TlsPhdr)
|
||||
SymVA = SignExtend64<sizeof(uintX_t) * 8>(
|
||||
getSymVA<ELFT>(Type, Addend, AddrLoc, Sym, R_ABS));
|
||||
getRelocTargetVA<ELFT>(Type, Addend, AddrLoc, Sym, R_ABS));
|
||||
Target->relocateOne(BufLoc, Type, SymVA);
|
||||
}
|
||||
}
|
||||
|
@ -535,29 +535,29 @@ void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd) {
|
|||
|
||||
uintX_t AddrLoc = OutSec->Addr + Offset;
|
||||
RelExpr Expr = Rel.Expr;
|
||||
uint64_t SymVA =
|
||||
SignExtend64<Bits>(getSymVA<ELFT>(Type, A, AddrLoc, *Rel.Sym, Expr));
|
||||
uint64_t TargetVA = SignExtend64<Bits>(
|
||||
getRelocTargetVA<ELFT>(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 @@ void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd) {
|
|||
write32be(BufLoc + 4, 0xe8410028); // ld %r2, 40(%r1)
|
||||
// fallthrough
|
||||
default:
|
||||
Target->relocateOne(BufLoc, Type, SymVA);
|
||||
Target->relocateOne(BufLoc, Type, TargetVA);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue