Adds x86 NONE relocation type
authorMoritz Angermann <moritz.angermann@gmail.com>
Tue, 3 Oct 2017 01:58:35 +0000 (09:58 +0800)
committerMoritz Angermann <moritz.angermann@gmail.com>
Tue, 3 Oct 2017 05:01:18 +0000 (13:01 +0800)
Summary:
As reported by Alex Lang, R_X86_64_NONE relocations
appear in per-package object files, not per-module object
files. This diff adds _NONE relocations for x86.

Reviewers: bgamari, geekosaur, austin, erikd, simonmar

Reviewed By: geekosaur

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D4062

rts/linker/Elf.c

index 58fa593..f2fd88f 100644 (file)
@@ -1097,6 +1097,7 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
 
        switch (reloc_type) {
 #        ifdef i386_HOST_ARCH
+       case COMPAT_R_386_NONE:                  break;
        case COMPAT_R_386_32:   *pP = value;     break;
        case COMPAT_R_386_PC32: *pP = value - P; break;
 #        endif
@@ -1571,6 +1572,9 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
 #        endif
 
 #if defined(x86_64_HOST_ARCH)
+      case COMPAT_R_X86_64_NONE:
+          break;
+
       case COMPAT_R_X86_64_64:
           *(Elf64_Xword *)P = value;
           break;