[PATCH] D21654: ELF/AMDGPU: Add support for R_AMDGPU_ABS32
Konstantin Zhuravlyov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 19 10:46:33 PDT 2016
kzhuravl updated this revision to Diff 64523.
kzhuravl added a comment.
Update test
https://reviews.llvm.org/D21654
Files:
ELF/Target.cpp
test/ELF/amdgpu-relocs.s
Index: test/ELF/amdgpu-relocs.s
===================================================================
--- test/ELF/amdgpu-relocs.s
+++ test/ELF/amdgpu-relocs.s
@@ -21,7 +21,10 @@
.weak weak_var
.weakref weakref_var, weakref_alias_var
-# The relocation for local_var should be resolved by the linker.
+.section .data.foo, "w", @progbits
+ .long var, global_var
+
+# The relocation for local_var and var should be resolved by the linker.
# CHECK: Relocations [
# CHECK: .rela.dyn {
# CHECK-NEXT: R_AMDGPU_ABS64 common_var 0x0
Index: ELF/Target.cpp
===================================================================
--- ELF/Target.cpp
+++ ELF/Target.cpp
@@ -1458,6 +1458,7 @@
void AMDGPUTargetInfo::relocateOne(uint8_t *Loc, uint32_t Type,
uint64_t Val) const {
switch (Type) {
+ case R_AMDGPU_ABS32:
case R_AMDGPU_GOTPCREL:
case R_AMDGPU_REL32:
write32le(Loc, Val);
@@ -1469,6 +1470,8 @@
RelExpr AMDGPUTargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const {
switch (Type) {
+ case R_AMDGPU_ABS32:
+ return R_ABS;
case R_AMDGPU_REL32:
return R_PC;
case R_AMDGPU_GOTPCREL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21654.64523.patch
Type: text/x-patch
Size: 1166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160719/730784c3/attachment.bin>
More information about the llvm-commits
mailing list