Index: llvm/trunk/include/llvm/MC/MCExpr.h =================================================================== --- llvm/trunk/include/llvm/MC/MCExpr.h +++ llvm/trunk/include/llvm/MC/MCExpr.h @@ -286,6 +286,7 @@ 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 Index: llvm/trunk/lib/MC/MCExpr.cpp =================================================================== --- llvm/trunk/lib/MC/MCExpr.cpp +++ llvm/trunk/lib/MC/MCExpr.cpp @@ -303,6 +303,7 @@ 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 @@ .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); } Index: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp =================================================================== --- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp +++ llvm/trunk/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: llvm/trunk/test/MC/AMDGPU/reloc.s =================================================================== --- llvm/trunk/test/MC/AMDGPU/reloc.s +++ llvm/trunk/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,@object .data .globl ptr + .globl foo .p2align 3 ptr: .quad temp .size ptr, 8 +foo: + .quad temp@rel64 + .size foo, 8