mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-07 11:51:13 +00:00
AMDGPU: Add 64-bit relative variant kind
Differential Revision: https://reviews.llvm.org/D47601 llvm-svn: 334443
This commit is contained in:
parent
a27dc5bdab
commit
0b1140868a
@ -286,6 +286,7 @@ public:
|
||||
VK_AMDGPU_GOTPCREL32_HI, // symbol@gotpcrel32@hi
|
||||
VK_AMDGPU_REL32_LO, // symbol@rel32@lo
|
||||
VK_AMDGPU_REL32_HI, // symbol@rel32@hi
|
||||
VK_AMDGPU_REL64, // symbol@rel64
|
||||
|
||||
VK_TPREL,
|
||||
VK_DTPREL
|
||||
|
@ -303,6 +303,7 @@ StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) {
|
||||
case VK_AMDGPU_GOTPCREL32_HI: return "gotpcrel32@hi";
|
||||
case VK_AMDGPU_REL32_LO: return "rel32@lo";
|
||||
case VK_AMDGPU_REL32_HI: return "rel32@hi";
|
||||
case VK_AMDGPU_REL64: return "rel64";
|
||||
}
|
||||
llvm_unreachable("Invalid variant kind");
|
||||
}
|
||||
@ -410,6 +411,7 @@ MCSymbolRefExpr::getVariantKindForName(StringRef Name) {
|
||||
.Case("gotpcrel32@hi", VK_AMDGPU_GOTPCREL32_HI)
|
||||
.Case("rel32@lo", VK_AMDGPU_REL32_LO)
|
||||
.Case("rel32@hi", VK_AMDGPU_REL32_HI)
|
||||
.Case("rel64", VK_AMDGPU_REL64)
|
||||
.Default(VK_Invalid);
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,8 @@ unsigned AMDGPUELFObjectWriter::getRelocType(MCContext &Ctx,
|
||||
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()) {
|
||||
|
@ -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 @@ kernel:
|
||||
.section nonalloc, "w", @progbits
|
||||
.long var, common_var
|
||||
|
||||
|
||||
// 8 byte relocations
|
||||
.type ptr,@object
|
||||
.data
|
||||
.globl ptr
|
||||
.globl foo
|
||||
.p2align 3
|
||||
ptr:
|
||||
.quad temp
|
||||
.size ptr, 8
|
||||
foo:
|
||||
.quad temp@rel64
|
||||
.size foo, 8
|
||||
|
Loading…
Reference in New Issue
Block a user