[llvm-branch-commits] [lld] r351446 - Merging r351335:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 17 05:47:57 PST 2019


Author: hans
Date: Thu Jan 17 05:47:57 2019
New Revision: 351446

URL: http://llvm.org/viewvc/llvm-project?rev=351446&view=rev
Log:
Merging r351335:
------------------------------------------------------------------------
r351335 | psmith | 2019-01-16 14:24:02 +0100 (Wed, 16 Jan 2019) | 17 lines

[ELF][AArch64] Add R_AARCH64_PLT_PAGE_PC to isRelExpr

As a follow on to D56666 (r351186) there is a case when taking the address
of an ifunc when linking -pie that can generate a spurious can't create
dynamic relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol in readonly
segment. Specifically the case is where the ifunc is in the same
translation unit as the address taker, so given -fpie the compiler knows
the ifunc is defined in the executable so it can use a non-got-generating
relocation.

The error message is due to R_AARCH64_PLT_PAGE_PC not being added to
isRelExpr, its non PLT equivalent R_AARCH64_PAGE_PC is already in
isRelExpr.

Differential Revision: https://reviews.llvm.org/D56724


------------------------------------------------------------------------

Added:
    lld/branches/release_80/test/ELF/aarch64-gnu-ifunc-address-pie.s
      - copied unchanged from r351335, lld/trunk/test/ELF/aarch64-gnu-ifunc-address-pie.s
Modified:
    lld/branches/release_80/   (props changed)
    lld/branches/release_80/ELF/Relocations.cpp

Propchange: lld/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 17 05:47:57 2019
@@ -1 +1 @@
-/lld/trunk:351326
+/lld/trunk:351326,351335

Modified: lld/branches/release_80/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_80/ELF/Relocations.cpp?rev=351446&r1=351445&r2=351446&view=diff
==============================================================================
--- lld/branches/release_80/ELF/Relocations.cpp (original)
+++ lld/branches/release_80/ELF/Relocations.cpp Thu Jan 17 05:47:57 2019
@@ -356,7 +356,7 @@ static bool needsGot(RelExpr Expr) {
 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_AARCH64_PAGE_PC,
-                        R_RELAX_GOT_PC>(Expr);
+                        R_AARCH64_PLT_PAGE_PC, R_RELAX_GOT_PC>(Expr);
 }
 
 // Returns true if a given relocation can be computed at link-time.




More information about the llvm-branch-commits mailing list