mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-23 12:40:17 +00:00
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@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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191163 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ecd4965c13
commit
7d7db75a55
@ -108,6 +108,9 @@ unsigned X86ELFObjectWriter::GetRelocType(const MCValue &Target,
|
||||
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;
|
||||
|
@ -19,6 +19,7 @@ bar:
|
||||
leaq foo-bar(%r14),%r14
|
||||
addq $bar,%rax # R_X86_64_32S
|
||||
.quad foo@DTPOFF
|
||||
movabsq $baz@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: }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user