Add support for R_X86_64_GOT64.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 9 Dec 2016 21:46:39 +0000 (21:46 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 9 Dec 2016 21:46:39 +0000 (21:46 +0000)
llvm-svn: 289277

lld/ELF/Target.cpp
lld/test/ELF/relocation.s

index f16853b..5106051 100644 (file)
@@ -611,6 +611,7 @@ RelExpr X86_64TargetInfo<ELFT>::getRelExpr(uint32_t Type,
   case R_X86_64_PC64:
     return R_PC;
   case R_X86_64_GOT32:
+  case R_X86_64_GOT64:
     return R_GOT_FROM_END;
   case R_X86_64_GOTPCREL:
   case R_X86_64_GOTPCRELX:
@@ -836,6 +837,7 @@ void X86_64TargetInfo<ELFT>::relocateOne(uint8_t *Loc, uint32_t Type,
   case R_X86_64_GLOB_DAT:
   case R_X86_64_PC64:
   case R_X86_64_SIZE64:
+  case R_X86_64_GOT64:
     write64le(Loc, Val);
     break;
   default:
index 6d12a91..452d1be 100644 (file)
@@ -132,3 +132,11 @@ R_X86_64_GOT32:
 
 // CHECK: Contents of section .R_X86_64_GOT32:
 // CHECK-NEXT: f8ffffff
+
+
+// CHECK: Contents of section .R_X86_64_GOT64:
+// CHECK-NEXT: f8ffffff ffffffff
+.section .R_X86_64_GOT64,"a",@progbits
+.global R_X86_64_GOT64
+R_X86_64_GOT64:
+        .quad zed@got