From: George Rimar Date: Thu, 15 Nov 2018 15:35:44 +0000 (+0000) Subject: [ELF] - Renamed few more AArch64 specific relocation expressions. NFC. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8329028b49131643a1353a8c86f4b9ced05311a7;p=platform%2Fupstream%2Fllvm.git [ELF] - Renamed few more AArch64 specific relocation expressions. NFC. They are AArch64 only, so have to have AARCH64_* prefix. llvm-svn: 346963 --- diff --git a/lld/ELF/Arch/AArch64.cpp b/lld/ELF/Arch/AArch64.cpp index 85fcc0b..08ffe2a 100644 --- a/lld/ELF/Arch/AArch64.cpp +++ b/lld/ELF/Arch/AArch64.cpp @@ -79,7 +79,7 @@ RelExpr AArch64::getRelExpr(RelType Type, const Symbol &S, 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, const Symbol &S, 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; diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index b337f37..749f5fd 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -668,11 +668,11 @@ static uint64_t getRelocTargetVA(const InputFile *File, RelType Type, int64_t A, 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 InputFile *File, RelType Type, int64_t A, 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: diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index b4ed71f..c1ef385 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -174,7 +174,7 @@ handleTlsRelocation(RelType Type, Symbol &Sym, InputSectionBase &C, if (Config->EMachine == EM_MIPS) return handleMipsTlsRelocation(Type, Sym, C, Offset, Addend, Expr); - if (isRelExprOneOf(Expr) && + if (isRelExprOneOf(Expr) && Config->Shared) { if (In.Got->addDynTlsEntry(Sym)) { uint64_t Off = In.Got->getGlobalDynOffset(Sym); @@ -230,8 +230,8 @@ handleTlsRelocation(RelType Type, Symbol &Sym, InputSectionBase &C, return 1; } - if (isRelExprOneOf(Expr)) { + if (isRelExprOneOf(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 &Sym) { // Returns true if Expr refers a PLT entry. static bool needsPlt(RelExpr Expr) { - return isRelExprOneOf(Expr); + return isRelExprOneOf( + 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(Expr); } @@ -362,8 +363,8 @@ static bool isStaticLinkTimeConstant(RelExpr E, RelType Type, const Symbol &Sym, 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: diff --git a/lld/ELF/Relocations.h b/lld/ELF/Relocations.h index 10c624d..a4e9024 100644 --- a/lld/ELF/Relocations.h +++ b/lld/ELF/Relocations.h @@ -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,