llvm.org GIT mirror llvm / 33649d7
AMDGPU/SI: Add support for R_AMDGPU_ABS32 Differential Revision: https://reviews.llvm.org/D21646 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276294 91177308-0d34-0410-b5e6-96231b3b80d8 Konstantin Zhuravlyov 4 years ago
3 changed file(s) with 18 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
134134 case llvm::ELF::R_SPARC_64:
135135 case llvm::ELF::R_SPARC_UA64:
136136 return visitELF_SPARCV9_64(R, Value);
137 default:
138 HasError = true;
139 return RelocToApply();
140 }
141 case Triple::amdgcn:
142 switch (RelocType) {
143 case llvm::ELF::R_AMDGPU_ABS32:
144 return visitELF_AMDGPU_ABS32(R, Value);
137145 default:
138146 HasError = true;
139147 return RelocToApply();
402410 return RelocToApply(static_cast(Res), 4);
403411 }
404412
413 RelocToApply visitELF_AMDGPU_ABS32(RelocationRef R, uint64_t Value) {
414 int64_t Addend = getELFAddend(R);
415 return RelocToApply(Value + Addend, 4);
416 }
417
405418 /// I386 COFF
406419 RelocToApply visitCOFF_I386_SECREL(RelocationRef R, uint64_t Value) {
407420 return RelocToApply(static_cast(Value), /*Width=*/4);
5555 default: break;
5656 case FK_PCRel_4:
5757 return ELF::R_AMDGPU_REL32;
58 case FK_Data_4:
5859 case FK_SecRel_4:
5960 return ELF::R_AMDGPU_ABS32;
6061 }
33 // CHECK: R_AMDGPU_ABS32_LO SCRATCH_RSRC_DWORD0 0x0
44 // CHECK: R_AMDGPU_ABS32_HI SCRATCH_RSRC_DWORD1 0x0
55 // CHECK: R_AMDGPU_GOTPCREL global_var 0x0
6 // CHECK: R_AMDGPU_ABS32 var 0x0
67 // CHECK: ]
78
89 kernel:
1314 .globl global_var
1415
1516 .globl SCRATCH_RSRC_DWORD0
17
18 .section nonalloc, "w", @progbits
19 .long var, common_var