[llvm-commits] [llvm] r115547 - in /llvm/trunk: lib/MC/ELFObjectWriter.cpp test/MC/ELF/got.s
Rafael Espindola
rafael.espindola at gmail.com
Mon Oct 4 12:51:40 PDT 2010
Author: rafael
Date: Mon Oct 4 14:51:39 2010
New Revision: 115547
URL: http://llvm.org/viewvc/llvm-project?rev=115547&view=rev
Log:
Implement ELF::R_X86_64_GOTPCREL.
Modified:
llvm/trunk/lib/MC/ELFObjectWriter.cpp
llvm/trunk/test/MC/ELF/got.s
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=115547&r1=115546&r2=115547&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Oct 4 14:51:39 2010
@@ -588,6 +588,9 @@
case MCSymbolRefExpr::VK_PLT:
Type = ELF::R_X86_64_PLT32;
break;
+ case llvm::MCSymbolRefExpr::VK_GOTPCREL:
+ Type = ELF::R_X86_64_GOTPCREL;
+ break;
default:
llvm_unreachable("Unimplemented");
}
Modified: llvm/trunk/test/MC/ELF/got.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/got.s?rev=115547&r1=115546&r2=115547&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/got.s (original)
+++ llvm/trunk/test/MC/ELF/got.s Mon Oct 4 14:51:39 2010
@@ -2,7 +2,8 @@
// Test that this produces a R_X86_64_GOT32.
- movl foo at GOT, %eax
+ movl foo at GOT, %eax
+ movl foo at GOTPCREL(%rip), %eax
// CHECK: ('_relocations', [
// CHECK-NEXT: # Relocation 0
@@ -11,4 +12,10 @@
// CHECK-NEXT: ('r_type', 3)
// CHECK-NEXT: ('r_addend',
// CHECK-NEXT: ),
+// CHECK-NEXT: # Relocation 1
+// CHECK-NEXT: (('r_offset',
+// CHECK-NEXT: ('r_sym',
+// CHECK-NEXT: ('r_type', 9)
+// CHECK-NEXT: ('r_addend',
+// CHECK-NEXT: ),
// CHECK-NEXT: ])
More information about the llvm-commits
mailing list