[commit: ghc] master: Add relocation type R_X86_64_REX_GOTPCRELX (0d963ca)

git at git.haskell.org git at git.haskell.org
Sun Jun 5 08:46:38 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0d963caf40da4391028a3beb95b5082c87985e7d/ghc

>---------------------------------------------------------------

commit 0d963caf40da4391028a3beb95b5082c87985e7d
Author: Tamar Christina <tamar at zhox.com>
Date:   Sun Jun 5 09:59:05 2016 +0200

    Add relocation type R_X86_64_REX_GOTPCRELX
    
    Summary:
    Adding support for the `R_X86_64_REX_GOTPCRELX` relocation type.
    This relocation is treated by the linker the same as the `R_X86_64_GOTPCRELX` type
    `G + GOT + A - P` to generate relative offsets to the GOT.
    The `REX` prefix has no influence in this stage.
    
    This is based on https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r252.pdf
    
    Test Plan: ./validate
    
    Reviewers: erikd, austin, bgamari, simonmar
    
    Reviewed By: erikd
    
    Subscribers: thomie, #ghc_windows_task_force
    
    Differential Revision: https://phabricator.haskell.org/D2303
    
    GHC Trac Issues: #12147


>---------------------------------------------------------------

0d963caf40da4391028a3beb95b5082c87985e7d
 rts/Linker.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/rts/Linker.c b/rts/Linker.c
index 5a6a8c2..a1f72e5 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -5681,7 +5681,13 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
           *(Elf64_Sword *)P = (Elf64_Sword)value;
 #endif
           break;
-
+/* These two relocations were introduced in glibc 2.23 and binutils 2.26.
+    But in order to use them the system which compiles the bindist for GHC needs
+    to have glibc >= 2.23. So only use them if they're defined. */
+#if defined(R_X86_64_REX_GOTPCRELX) && defined(R_X86_64_GOTPCRELX)
+      case R_X86_64_REX_GOTPCRELX:
+      case R_X86_64_GOTPCRELX:
+#endif
       case R_X86_64_GOTPCREL:
       {
           StgInt64 gotAddress = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)->addr;



More information about the ghc-commits mailing list