diff options
author | George Rimar <grimar@accesssoftek.com> | 2018-11-13 10:16:36 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2018-11-13 10:16:36 +0000 |
commit | 8ef9babb67c49e3fca34ef285f19d848c52499dc (patch) | |
tree | fb08812aa45e35663a8de604485c92233c9c3ab7 | |
parent | 7717a5cd8c97f20ef8c0bea0493edb309987420b (diff) | |
download | bcm5719-llvm-8ef9babb67c49e3fca34ef285f19d848c52499dc.tar.gz bcm5719-llvm-8ef9babb67c49e3fca34ef285f19d848c52499dc.zip |
[ELF] - Renamed AArch64 specific relocations expressions. NFC.
They did not have AArch64 prefix. Now they do.
llvm-svn: 346749
-rw-r--r-- | lld/ELF/Arch/AArch64.cpp | 4 | ||||
-rw-r--r-- | lld/ELF/InputSection.cpp | 6 | ||||
-rw-r--r-- | lld/ELF/Relocations.cpp | 21 | ||||
-rw-r--r-- | lld/ELF/Relocations.h | 4 |
4 files changed, 18 insertions, 17 deletions
diff --git a/lld/ELF/Arch/AArch64.cpp b/lld/ELF/Arch/AArch64.cpp index 89c79ca40e3..85fcc0b8fc5 100644 --- a/lld/ELF/Arch/AArch64.cpp +++ b/lld/ELF/Arch/AArch64.cpp @@ -111,7 +111,7 @@ RelExpr AArch64::getRelExpr(RelType Type, const Symbol &S, return R_GOT; case R_AARCH64_ADR_GOT_PAGE: case R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: - return R_GOT_PAGE_PC; + return R_AARCH64_GOT_PAGE_PC; case R_AARCH64_NONE: return R_NONE; default: @@ -123,7 +123,7 @@ RelExpr AArch64::adjustRelaxExpr(RelType Type, const uint8_t *Data, RelExpr Expr) const { if (Expr == R_RELAX_TLS_GD_TO_IE) { if (Type == R_AARCH64_TLSDESC_ADR_PAGE21) - return R_RELAX_TLS_GD_TO_IE_PAGE_PC; + return R_AARCH64_RELAX_TLS_GD_TO_IE_PAGE_PC; return R_RELAX_TLS_GD_TO_IE_ABS; } return Expr; diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index daff31bfc08..4dc69c179c8 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -622,8 +622,8 @@ static uint64_t getRelocTargetVA(const InputFile *File, RelType Type, int64_t A, case R_GOT_OFF: case R_RELAX_TLS_GD_TO_IE_GOT_OFF: return Sym.getGotOffset() + A; - case R_GOT_PAGE_PC: - case R_RELAX_TLS_GD_TO_IE_PAGE_PC: + case R_AARCH64_GOT_PAGE_PC: + case R_AARCH64_RELAX_TLS_GD_TO_IE_PAGE_PC: return getAArch64Page(Sym.getGotVA() + A) - getAArch64Page(P); case R_GOT_PC: case R_RELAX_TLS_GD_TO_IE: @@ -894,10 +894,10 @@ void InputSectionBase::relocateAlloc(uint8_t *Buf, uint8_t *BufEnd) { case R_RELAX_TLS_GD_TO_LE_NEG: Target->relaxTlsGdToLe(BufLoc, Type, TargetVA); break; + case R_AARCH64_RELAX_TLS_GD_TO_IE_PAGE_PC: case R_RELAX_TLS_GD_TO_IE: case R_RELAX_TLS_GD_TO_IE_ABS: case R_RELAX_TLS_GD_TO_IE_GOT_OFF: - case R_RELAX_TLS_GD_TO_IE_PAGE_PC: case R_RELAX_TLS_GD_TO_IE_END: Target->relaxTlsGdToIe(BufLoc, Type, TargetVA); break; diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index fb31cd63feb..d2c4bbba71c 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -271,8 +271,8 @@ handleTlsRelocation(RelType Type, Symbol &Sym, InputSectionBase &C, // Initial-Exec relocs can be relaxed to Local-Exec if the symbol is locally // defined. - if (isRelExprOneOf<R_GOT, R_GOT_FROM_END, R_GOT_PC, R_GOT_PAGE_PC, R_GOT_OFF, - R_TLSIE_HINT>(Expr) && + if (isRelExprOneOf<R_GOT, R_GOT_FROM_END, R_GOT_PC, R_AARCH64_GOT_PAGE_PC, + R_GOT_OFF, R_TLSIE_HINT>(Expr) && !Config->Shared && !Sym.IsPreemptible) { C.Relocations.push_back({R_RELAX_TLS_IE_TO_LE, Type, Offset, Addend, &Sym}); return 1; @@ -332,7 +332,7 @@ static bool needsPlt(RelExpr Expr) { // TLS variables uses GOT differently than the regular variables. static bool needsGot(RelExpr Expr) { return isRelExprOneOf<R_GOT, R_GOT_OFF, R_HEXAGON_GOT, R_MIPS_GOT_LOCAL_PAGE, - R_MIPS_GOT_OFF, R_MIPS_GOT_OFF32, R_GOT_PAGE_PC, + R_MIPS_GOT_OFF, R_MIPS_GOT_OFF32, R_AARCH64_GOT_PAGE_PC, R_GOT_PC, R_GOT_FROM_END>(Expr); } @@ -356,13 +356,14 @@ static bool isRelExpr(RelExpr Expr) { static bool isStaticLinkTimeConstant(RelExpr E, RelType Type, const Symbol &Sym, InputSectionBase &S, uint64_t RelOff) { // These expressions always compute a constant - if (isRelExprOneOf< - R_GOT_FROM_END, R_GOT_OFF, R_HEXAGON_GOT, R_TLSLD_GOT_OFF, - R_MIPS_GOT_LOCAL_PAGE, R_MIPS_GOTREL, R_MIPS_GOT_OFF, - R_MIPS_GOT_OFF32, R_MIPS_GOT_GP_PC, R_MIPS_TLSGD, R_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)) + if (isRelExprOneOf<R_GOT_FROM_END, R_GOT_OFF, R_HEXAGON_GOT, R_TLSLD_GOT_OFF, + R_MIPS_GOT_LOCAL_PAGE, R_MIPS_GOTREL, R_MIPS_GOT_OFF, + R_MIPS_GOT_OFF32, R_MIPS_GOT_GP_PC, R_MIPS_TLSGD, + 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)) return true; // These never do, except if the entire file is position dependent or if diff --git a/lld/ELF/Relocations.h b/lld/ELF/Relocations.h index bbb8d93bcab..10c624da5d1 100644 --- a/lld/ELF/Relocations.h +++ b/lld/ELF/Relocations.h @@ -33,6 +33,8 @@ enum RelExpr { R_INVALID, R_ABS, R_ADDEND, + R_AARCH64_GOT_PAGE_PC, + R_AARCH64_RELAX_TLS_GD_TO_IE_PAGE_PC, R_ARM_SBREL, R_GOT, R_GOTONLY_PC, @@ -41,7 +43,6 @@ enum RelExpr { R_GOTREL_FROM_END, R_GOT_FROM_END, R_GOT_OFF, - R_GOT_PAGE_PC, R_GOT_PC, R_HEXAGON_GOT, R_HINT, @@ -69,7 +70,6 @@ enum RelExpr { R_RELAX_TLS_GD_TO_IE_ABS, R_RELAX_TLS_GD_TO_IE_END, R_RELAX_TLS_GD_TO_IE_GOT_OFF, - R_RELAX_TLS_GD_TO_IE_PAGE_PC, R_RELAX_TLS_GD_TO_LE, R_RELAX_TLS_GD_TO_LE_NEG, R_RELAX_TLS_IE_TO_LE, |