Index: lld/trunk/ELF/Arch/AMDGPU.cpp =================================================================== --- lld/trunk/ELF/Arch/AMDGPU.cpp +++ lld/trunk/ELF/Arch/AMDGPU.cpp @@ -66,6 +66,7 @@ write32le(Loc, Val); break; case R_AMDGPU_ABS64: + case R_AMDGPU_REL64: write64le(Loc, Val); break; case R_AMDGPU_GOTPCREL32_HI: @@ -86,6 +87,7 @@ case R_AMDGPU_REL32: case R_AMDGPU_REL32_LO: case R_AMDGPU_REL32_HI: + case R_AMDGPU_REL64: return R_PC; case R_AMDGPU_GOTPCREL: case R_AMDGPU_GOTPCREL32_LO: Index: lld/trunk/test/ELF/amdgpu-relocs.s =================================================================== --- lld/trunk/test/ELF/amdgpu-relocs.s +++ lld/trunk/test/ELF/amdgpu-relocs.s @@ -77,6 +77,15 @@ ptr2: .quad temp2 +# R_AMDGPU_REL64: +.type foo, @object +.rodata + .globl foo + .p2align 3 +foo: + .quad temp2@rel64 + .size foo, 8 + # The relocation for local_var{0, 1, 2} and var should be resolved by the # linker. # CHECK: Relocations [ @@ -101,6 +110,9 @@ # CHECK-NEXT: } # CHECK-NEXT: ] +# OBJDUMP: Contents of section .rodata: +# OBJDUMP: 28fbffff ffffffff + # OBJDUMP: Contents of section nonalloc: # OBJDUMP-NEXT: 0000 00000000 04480000 00000000 08440000 # OBJDUMP-NEXT: 00000000 0c400000