[lld] r247688 - Add support for R_X86_64_64.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 15 06:52:06 PDT 2015
Author: rafael
Date: Tue Sep 15 08:52:06 2015
New Revision: 247688
URL: http://llvm.org/viewvc/llvm-project?rev=247688&view=rev
Log:
Add support for R_X86_64_64.
Modified:
lld/trunk/ELF/Writer.cpp
lld/trunk/test/elf2/relocation.s
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=247688&r1=247687&r2=247688&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Sep 15 08:52:06 2015
@@ -490,6 +490,9 @@ template <class ELFT> void OutputSection
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;
Modified: lld/trunk/test/elf2/relocation.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/relocation.s?rev=247688&r1=247687&r2=247688&view=diff
==============================================================================
--- lld/trunk/test/elf2/relocation.s (original)
+++ lld/trunk/test/elf2/relocation.s Tue Sep 15 08:52:06 2015
@@ -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", at 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", at 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
More information about the llvm-commits
mailing list