mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-25 21:11:25 +00:00
[ELF][MIPS] Rename R_MIPS_GOT_xxx relocation expression kinds
New names reflect purpose of corresponding GOT entries better. Both expression types related to entries allocated in the 'local' part of MIPS GOT. R_MIPS_GOT_LOCAL_PAGE is for entries contain 'page' addresses. R_MIPS_GOT_LOCAL is for entries contain 'full' address. llvm-svn: 269597
This commit is contained in:
parent
ecdd13d788
commit
4e3a15c9f3
@ -191,12 +191,12 @@ getSymVA(uint32_t Type, typename ELFT::uint A, typename ELFT::uint P,
|
||||
return Body.getVA<ELFT>(A);
|
||||
case R_GOT_OFF:
|
||||
return Body.getGotOffset<ELFT>() + A;
|
||||
case R_MIPS_GOT_LOCAL:
|
||||
case R_MIPS_GOT_LOCAL_PAGE:
|
||||
// If relocation against MIPS local symbol requires GOT entry, this entry
|
||||
// should be initialized by 'page address'. This address is high 16-bits
|
||||
// of sum the symbol's value and the addend.
|
||||
return Out<ELFT>::Got->getMipsLocalPageOffset(Body.getVA<ELFT>(A));
|
||||
case R_MIPS_GOT:
|
||||
case R_MIPS_GOT_LOCAL:
|
||||
// For non-local symbols GOT entries should contain their full
|
||||
// addresses. But if such symbol cannot be preempted, we do not
|
||||
// have to put them into the "global" part of GOT and use dynamic
|
||||
|
@ -36,8 +36,8 @@ enum RelExpr {
|
||||
R_GOT_PAGE_PC,
|
||||
R_GOT_PC,
|
||||
R_HINT,
|
||||
R_MIPS_GOT,
|
||||
R_MIPS_GOT_LOCAL,
|
||||
R_MIPS_GOT_LOCAL_PAGE,
|
||||
R_NEG_TLS,
|
||||
R_PAGE_PC,
|
||||
R_PC,
|
||||
@ -61,8 +61,8 @@ enum RelExpr {
|
||||
};
|
||||
|
||||
inline bool refersToGotEntry(RelExpr Expr) {
|
||||
return Expr == R_GOT || Expr == R_GOT_OFF || Expr == R_MIPS_GOT ||
|
||||
Expr == R_MIPS_GOT_LOCAL || Expr == R_GOT_PAGE_PC ||
|
||||
return Expr == R_GOT || Expr == R_GOT_OFF || Expr == R_MIPS_GOT_LOCAL ||
|
||||
Expr == R_MIPS_GOT_LOCAL_PAGE || Expr == R_GOT_PAGE_PC ||
|
||||
Expr == R_GOT_PC || Expr == R_GOT_FROM_END || Expr == R_TLSGD ||
|
||||
Expr == R_TLSGD_PC;
|
||||
}
|
||||
|
@ -1281,15 +1281,15 @@ RelExpr MipsTargetInfo<ELFT>::getRelExpr(uint32_t Type,
|
||||
return R_PC;
|
||||
case R_MIPS_GOT16:
|
||||
if (S.isLocal())
|
||||
return R_MIPS_GOT_LOCAL;
|
||||
return R_MIPS_GOT_LOCAL_PAGE;
|
||||
// fallthrough
|
||||
case R_MIPS_CALL16:
|
||||
case R_MIPS_GOT_DISP:
|
||||
if (!S.isPreemptible())
|
||||
return R_MIPS_GOT;
|
||||
return R_MIPS_GOT_LOCAL;
|
||||
return R_GOT_OFF;
|
||||
case R_MIPS_GOT_PAGE:
|
||||
return R_MIPS_GOT_LOCAL;
|
||||
return R_MIPS_GOT_LOCAL_PAGE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -457,9 +457,10 @@ template <class ELFT>
|
||||
static bool isStaticLinkTimeConstant(RelExpr E, uint32_t Type,
|
||||
const SymbolBody &Body) {
|
||||
// These expressions always compute a constant
|
||||
if (E == R_SIZE || E == R_GOT_FROM_END || E == R_GOT_OFF || E == R_MIPS_GOT ||
|
||||
E == R_MIPS_GOT_LOCAL || E == R_GOT_PAGE_PC || E == R_GOT_PC ||
|
||||
E == R_PLT_PC || E == R_TLSGD_PC || E == R_TLSGD || E == R_PPC_PLT_OPD)
|
||||
if (E == R_SIZE || E == R_GOT_FROM_END || E == R_GOT_OFF ||
|
||||
E == R_MIPS_GOT_LOCAL || E == R_MIPS_GOT_LOCAL_PAGE ||
|
||||
E == R_GOT_PAGE_PC || E == R_GOT_PC || E == R_PLT_PC || E == R_TLSGD_PC ||
|
||||
E == R_TLSGD || E == R_PPC_PLT_OPD)
|
||||
return true;
|
||||
|
||||
// These never do, except if the entire file is position dependent or if
|
||||
|
Loading…
x
Reference in New Issue
Block a user