[PATCH] D47601: AMDGPU: Add 64-bit relative variant kind
Konstantin Zhuravlyov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 31 12:31:27 PDT 2018
kzhuravl created this revision.
kzhuravl added reviewers: arsenm, rampitec, t-tye.
Herald added subscribers: tpr, dstuttard, yaxunl, nhaehnle, wdng.
https://reviews.llvm.org/D47601
Files:
include/llvm/MC/MCExpr.h
lib/MC/MCExpr.cpp
lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp
test/MC/AMDGPU/reloc.s
Index: test/MC/AMDGPU/reloc.s
===================================================================
--- test/MC/AMDGPU/reloc.s
+++ test/MC/AMDGPU/reloc.s
@@ -13,6 +13,7 @@
// CHECK: }
// CHECK: .rel.data {
// CHECK: R_AMDGPU_ABS64 temp 0x0
+// CHECK: R_AMDGPU_REL64 temp 0x0
// CHECK: }
// CHECK: ]
@@ -36,12 +37,15 @@
.section nonalloc, "w", @progbits
.long var, common_var
-
// 8 byte relocations
.type ptr, at object
.data
.globl ptr
+ .globl foo
.p2align 3
ptr:
.quad temp
.size ptr, 8
+foo:
+ .quad temp at rel64
+ .size foo, 8
Index: lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp
===================================================================
--- lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp
+++ lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp
@@ -66,6 +66,8 @@
return ELF::R_AMDGPU_REL32_LO;
case MCSymbolRefExpr::VK_AMDGPU_REL32_HI:
return ELF::R_AMDGPU_REL32_HI;
+ case MCSymbolRefExpr::VK_AMDGPU_REL64:
+ return ELF::R_AMDGPU_REL64;
}
switch (Fixup.getKind()) {
Index: lib/MC/MCExpr.cpp
===================================================================
--- lib/MC/MCExpr.cpp
+++ lib/MC/MCExpr.cpp
@@ -303,6 +303,7 @@
case VK_AMDGPU_GOTPCREL32_HI: return "gotpcrel32 at hi";
case VK_AMDGPU_REL32_LO: return "rel32 at lo";
case VK_AMDGPU_REL32_HI: return "rel32 at hi";
+ case VK_AMDGPU_REL64: return "rel64";
}
llvm_unreachable("Invalid variant kind");
}
@@ -410,6 +411,7 @@
.Case("gotpcrel32 at hi", VK_AMDGPU_GOTPCREL32_HI)
.Case("rel32 at lo", VK_AMDGPU_REL32_LO)
.Case("rel32 at hi", VK_AMDGPU_REL32_HI)
+ .Case("rel64", VK_AMDGPU_REL64)
.Default(VK_Invalid);
}
Index: include/llvm/MC/MCExpr.h
===================================================================
--- include/llvm/MC/MCExpr.h
+++ include/llvm/MC/MCExpr.h
@@ -286,6 +286,7 @@
VK_AMDGPU_GOTPCREL32_HI, // symbol at gotpcrel32@hi
VK_AMDGPU_REL32_LO, // symbol at rel32@lo
VK_AMDGPU_REL32_HI, // symbol at rel32@hi
+ VK_AMDGPU_REL64, // symbol at rel64
VK_TPREL,
VK_DTPREL
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47601.149341.patch
Type: text/x-patch
Size: 2091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180531/4a1927df/attachment.bin>
More information about the llvm-commits
mailing list