[llvm] r191163 - X86: Use R_X86_64_TPOFF64 for FK_Data_8
David Majnemer
david.majnemer at gmail.com
Sat Sep 21 22:30:16 PDT 2013
Author: majnemer
Date: Sun Sep 22 00:30:16 2013
New Revision: 191163
URL: http://llvm.org/viewvc/llvm-project?rev=191163&view=rev
Log:
X86: Use R_X86_64_TPOFF64 for FK_Data_8
Summary:
LLVM would crash when trying to come up with a relocation type for
assembly like:
movabsq $V at TPOFF, %rax
Instead, we say the relocation type is R_X86_64_TPOFF64.
Fixes PR17274.
Reviewers: dblaikie, nrieck, rafael
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1717
Modified:
llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
llvm/trunk/test/MC/ELF/relocation.s
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp?rev=191163&r1=191162&r2=191163&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp Sun Sep 22 00:30:16 2013
@@ -108,6 +108,9 @@ unsigned X86ELFObjectWriter::GetRelocTyp
case MCSymbolRefExpr::VK_None:
Type = ELF::R_X86_64_64;
break;
+ case MCSymbolRefExpr::VK_TPOFF:
+ Type = ELF::R_X86_64_TPOFF64;
+ break;
case MCSymbolRefExpr::VK_DTPOFF:
Type = ELF::R_X86_64_DTPOFF64;
break;
Modified: llvm/trunk/test/MC/ELF/relocation.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation.s?rev=191163&r1=191162&r2=191163&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/relocation.s (original)
+++ llvm/trunk/test/MC/ELF/relocation.s Sun Sep 22 00:30:16 2013
@@ -19,6 +19,7 @@ bar:
leaq foo-bar(%r14),%r14
addq $bar,%rax # R_X86_64_32S
.quad foo at DTPOFF
+ movabsq $baz at TPOFF, %rax
// CHECK: Section {
// CHECK: Name: .rela.text
@@ -39,6 +40,7 @@ bar:
// CHECK-NEXT: 0x5C R_X86_64_PC32 foo 0x5C
// CHECK-NEXT: 0x63 R_X86_64_32S .text 0x0
// CHECK-NEXT: 0x67 R_X86_64_DTPOFF64 foo 0x0
+// CHECK-NEXT: 0x71 R_X86_64_TPOFF64 baz 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: }
More information about the llvm-commits
mailing list