Add support for R_X86_64_64.

llvm-svn: 247688
This commit is contained in:
Rafael Espindola 2015-09-15 13:52:06 +00:00
parent 360a543d04
commit a5c97d9025
2 changed files with 16 additions and 5 deletions

View File

@ -490,6 +490,9 @@ template <class ELFT> void OutputSection<ELFT>::writeTo(uint8_t *Buf) {
support::endian::write32le(Location,
SymVA + (RI.r_addend - (P + Offset)));
break;
case llvm::ELF::R_X86_64_64:
support::endian::write64le(Location, SymVA + RI.r_addend);
break;
case llvm::ELF::R_X86_64_32:
support::endian::write32le(Location, SymVA + RI.r_addend);
break;

View File

@ -1,6 +1,6 @@
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
// RUN: lld -flavor gnu2 %t -o %t2
// RUN: llvm-objdump -d %t2 | FileCheck %s
// RUN: llvm-objdump -s -d %t2 | FileCheck %s
// REQUIRES: x86
@ -24,13 +24,21 @@ lulz:
// CHECK-NEXT: 11009: 90 nop
.global bar
.section .text2,"ax",@progbits
bar:
movl $bar, %edx // R_X86_64_32
.global R_X86_64_32
R_X86_64_32:
movl $R_X86_64_32, %edx
// FIXME: this would be far more self evident if llvm-objdump printed
// constants in hex.
// CHECK: Disassembly of section .text2:
// CHECK-NEXT: bar:
// CHECK-NEXT: R_X86_64_32:
// CHECK-NEXT: 12000: {{.*}} movl $73728, %edx
.section .R_X86_64_64,"a",@progbits
.global R_X86_64_64
R_X86_64_64:
.quad R_X86_64_64
// CHECK: Contents of section .R_X86_64_64:
// CHECK-NEXT: 13000 00300100 00000000