[lld] r346749 - [ELF] - Renamed AArch64 specific relocations expressions. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 21:58:17 PST 2018


Thanks!

On Tue, Nov 13, 2018 at 7:19 PM George Rimar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: grimar
> Date: Tue Nov 13 02:16:36 2018
> New Revision: 346749
>
> URL: http://llvm.org/viewvc/llvm-project?rev=346749&view=rev
> Log:
> [ELF] - Renamed AArch64 specific relocations expressions. NFC.
>
> They did not have AArch64 prefix. Now they do.
>
> 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=346749&r1=346748&r2=346749&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Arch/AArch64.cpp (original)
> +++ lld/trunk/ELF/Arch/AArch64.cpp Tue Nov 13 02:16:36 2018
> @@ -111,7 +111,7 @@ RelExpr AArch64::getRelExpr(RelType Type
>      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
>                                   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;
>
> Modified: lld/trunk/ELF/InputSection.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=346749&r1=346748&r2=346749&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/InputSection.cpp (original)
> +++ lld/trunk/ELF/InputSection.cpp Tue Nov 13 02:16:36 2018
> @@ -622,8 +622,8 @@ static uint64_t getRelocTargetVA(const I
>    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(uin
>      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;
>
> Modified: lld/trunk/ELF/Relocations.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=346749&r1=346748&r2=346749&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Relocations.cpp (original)
> +++ lld/trunk/ELF/Relocations.cpp Tue Nov 13 02:16:36 2018
> @@ -271,8 +271,8 @@ handleTlsRelocation(RelType Type, Symbol
>
>    // 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
>
> Modified: lld/trunk/ELF/Relocations.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.h?rev=346749&r1=346748&r2=346749&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Relocations.h (original)
> +++ lld/trunk/ELF/Relocations.h Tue Nov 13 02:16:36 2018
> @@ -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,
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181114/dfbde04e/attachment.html>


More information about the llvm-commits mailing list