void RISCVTargetInfo<ELFT>::relocateOne(uint8_t *Loc, uint32_t Type,
uint64_t Val);
Tells how to encode result.
Loc: the address to relocate
Type: target specific relocation type
Val: target symbol value (to be detailed later.)
getRelocTargetVA(uint32_t Type, int64_t A, typename ELFT::uint P,
const SymbolBody &Body, RelExpr Expr);
Determine target symbol value
Type: target-dependent relocation type
A: addend
P: address of instruction contains this relocation
Body: the symbol used to perform relocation
Expr: target-independent relocation type
example:
for case R_ABS:
return Body.getVA(A); // S + A
for case R_PC:
return Body.getVA(A) - P; // S + A - P
RelExpr RISCVTargetInfo<ELFT>::getRelExpr(uint32_t Type, const SymbolBody &S,
const uint8_t *Loc) const ;
classify target-dependent relocation type as target-independent relocation type, so that lld can abstract common operation.