[lld] r346963 - [ELF] - Renamed few more AArch64 specific relocation expressions. NFC.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 15 07:35:44 PST 2018
Author: grimar
Date: Thu Nov 15 07:35:44 2018
New Revision: 346963
URL: http://llvm.org/viewvc/llvm-project?rev=346963&view=rev
Log:
[ELF] - Renamed few more AArch64 specific relocation expressions. NFC.
They are AArch64 only, so have to have AARCH64_* prefix.
Modified:
lld/trunk/ELF/Arch/AArch64.cpp
lld/trunk/ELF/InputSection.cpp
lld/trunk/ELF/Relocations.cpp
lld/trunk/ELF/Relocations.h
Modified: lld/trunk/ELF/Arch/AArch64.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/AArch64.cpp?rev=346963&r1=346962&r2=346963&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/AArch64.cpp (original)
+++ lld/trunk/ELF/Arch/AArch64.cpp Thu Nov 15 07:35:44 2018
@@ -79,7 +79,7 @@ RelExpr AArch64::getRelExpr(RelType Type
const uint8_t *Loc) const {
switch (Type) {
case R_AARCH64_TLSDESC_ADR_PAGE21:
- return R_TLSDESC_PAGE;
+ return R_AARCH64_TLSDESC_PAGE;
case R_AARCH64_TLSDESC_LD64_LO12:
case R_AARCH64_TLSDESC_ADD_LO12:
return R_TLSDESC;
@@ -105,7 +105,7 @@ RelExpr AArch64::getRelExpr(RelType Type
case R_AARCH64_LD_PREL_LO19:
return R_PC;
case R_AARCH64_ADR_PREL_PG_HI21:
- return R_PAGE_PC;
+ return R_AARCH64_PAGE_PC;
case R_AARCH64_LD64_GOT_LO12_NC:
case R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
return R_GOT;
Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=346963&r1=346962&r2=346963&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Thu Nov 15 07:35:44 2018
@@ -668,11 +668,11 @@ static uint64_t getRelocTargetVA(const I
case R_MIPS_TLSLD:
return In.MipsGot->getVA() + In.MipsGot->getTlsIndexOffset(File) -
In.MipsGot->getGp(File);
- case R_PAGE_PC: {
+ case R_AARCH64_PAGE_PC: {
uint64_t Val = Sym.isUndefWeak() ? A : Sym.getVA(A);
return getAArch64Page(Val) - getAArch64Page(P);
}
- case R_PLT_PAGE_PC: {
+ case R_AARCH64_PLT_PAGE_PC: {
uint64_t Val = Sym.isUndefWeak() ? A : Sym.getPltVA() + A;
return getAArch64Page(Val) - getAArch64Page(P);
}
@@ -743,7 +743,7 @@ static uint64_t getRelocTargetVA(const I
return Sym.getSize() + A;
case R_TLSDESC:
return In.Got->getGlobalDynAddr(Sym) + A;
- case R_TLSDESC_PAGE:
+ case R_AARCH64_TLSDESC_PAGE:
return getAArch64Page(In.Got->getGlobalDynAddr(Sym) + A) -
getAArch64Page(P);
case R_TLSGD_GOT:
Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=346963&r1=346962&r2=346963&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Thu Nov 15 07:35:44 2018
@@ -174,7 +174,7 @@ handleTlsRelocation(RelType Type, Symbol
if (Config->EMachine == EM_MIPS)
return handleMipsTlsRelocation(Type, Sym, C, Offset, Addend, Expr);
- if (isRelExprOneOf<R_TLSDESC, R_TLSDESC_PAGE, R_TLSDESC_CALL>(Expr) &&
+ if (isRelExprOneOf<R_TLSDESC, R_AARCH64_TLSDESC_PAGE, R_TLSDESC_CALL>(Expr) &&
Config->Shared) {
if (In.Got->addDynTlsEntry(Sym)) {
uint64_t Off = In.Got->getGlobalDynOffset(Sym);
@@ -230,8 +230,8 @@ handleTlsRelocation(RelType Type, Symbol
return 1;
}
- if (isRelExprOneOf<R_TLSDESC, R_TLSDESC_PAGE, R_TLSDESC_CALL, R_TLSGD_GOT,
- R_TLSGD_GOT_FROM_END, R_TLSGD_PC>(Expr)) {
+ if (isRelExprOneOf<R_TLSDESC, R_AARCH64_TLSDESC_PAGE, R_TLSDESC_CALL,
+ R_TLSGD_GOT, R_TLSGD_GOT_FROM_END, R_TLSGD_PC>(Expr)) {
if (Config->Shared) {
if (In.Got->addDynTlsEntry(Sym)) {
uint64_t Off = In.Got->getGlobalDynOffset(Sym);
@@ -324,7 +324,8 @@ static bool isAbsoluteValue(const Symbol
// Returns true if Expr refers a PLT entry.
static bool needsPlt(RelExpr Expr) {
- return isRelExprOneOf<R_PLT_PC, R_PPC_CALL_PLT, R_PLT, R_PLT_PAGE_PC>(Expr);
+ return isRelExprOneOf<R_PLT_PC, R_PPC_CALL_PLT, R_PLT, R_AARCH64_PLT_PAGE_PC>(
+ Expr);
}
// Returns true if Expr refers a GOT entry. Note that this function
@@ -340,7 +341,7 @@ static bool needsGot(RelExpr Expr) {
// file (PC, or GOT for example).
static bool isRelExpr(RelExpr Expr) {
return isRelExprOneOf<R_PC, R_GOTREL, R_GOTREL_FROM_END, R_MIPS_GOTREL,
- R_PPC_CALL, R_PPC_CALL_PLT, R_PAGE_PC,
+ R_PPC_CALL, R_PPC_CALL_PLT, R_AARCH64_PAGE_PC,
R_RELAX_GOT_PC>(Expr);
}
@@ -362,8 +363,8 @@ static bool isStaticLinkTimeConstant(Rel
R_AARCH64_GOT_PAGE_PC, R_GOT_PC, R_GOTONLY_PC,
R_GOTONLY_PC_FROM_END, R_PLT_PC, R_TLSGD_GOT,
R_TLSGD_GOT_FROM_END, R_TLSGD_PC, R_PPC_CALL_PLT,
- R_TLSDESC_CALL, R_TLSDESC_PAGE, R_HINT, R_TLSLD_HINT,
- R_TLSIE_HINT>(E))
+ R_TLSDESC_CALL, R_AARCH64_TLSDESC_PAGE, R_HINT,
+ R_TLSLD_HINT, R_TLSIE_HINT>(E))
return true;
// These never do, except if the entire file is position dependent or if
@@ -414,8 +415,8 @@ static RelExpr toPlt(RelExpr Expr) {
return R_PPC_CALL_PLT;
case R_PC:
return R_PLT_PC;
- case R_PAGE_PC:
- return R_PLT_PAGE_PC;
+ case R_AARCH64_PAGE_PC:
+ return R_AARCH64_PLT_PAGE_PC;
case R_ABS:
return R_PLT;
default:
Modified: lld/trunk/ELF/Relocations.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.h?rev=346963&r1=346962&r2=346963&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.h (original)
+++ lld/trunk/ELF/Relocations.h Thu Nov 15 07:35:44 2018
@@ -35,6 +35,9 @@ enum RelExpr {
R_ADDEND,
R_AARCH64_GOT_PAGE_PC,
R_AARCH64_RELAX_TLS_GD_TO_IE_PAGE_PC,
+ R_AARCH64_PAGE_PC,
+ R_AARCH64_PLT_PAGE_PC,
+ R_AARCH64_TLSDESC_PAGE,
R_ARM_SBREL,
R_GOT,
R_GOTONLY_PC,
@@ -56,10 +59,8 @@ enum RelExpr {
R_MIPS_TLSLD,
R_NEG_TLS,
R_NONE,
- R_PAGE_PC,
R_PC,
R_PLT,
- R_PLT_PAGE_PC,
R_PLT_PC,
R_PPC_CALL,
R_PPC_CALL_PLT,
@@ -80,7 +81,6 @@ enum RelExpr {
R_TLS,
R_TLSDESC,
R_TLSDESC_CALL,
- R_TLSDESC_PAGE,
R_TLSGD_GOT,
R_TLSGD_GOT_FROM_END,
R_TLSGD_PC,
More information about the llvm-commits
mailing list