[PATCH] D21654: ELF/AMDGPU: Add support for R_AMDGPU_ABS32

Konstantin Zhuravlyov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 14:34:10 PDT 2016


kzhuravl updated this revision to Diff 63139.
kzhuravl added a comment.

Rebase and update test


http://reviews.llvm.org/D21654

Files:
  ELF/Target.cpp
  test/ELF/amdgpu-elf64-dwarf-relocs.ll

Index: test/ELF/amdgpu-elf64-dwarf-relocs.ll
===================================================================
--- test/ELF/amdgpu-elf64-dwarf-relocs.ll
+++ test/ELF/amdgpu-elf64-dwarf-relocs.ll
@@ -0,0 +1,34 @@
+; REQUIRES: amdgpu
+
+; RUN: llc -filetype=obj -mtriple=amdgcn--amdhsa -mcpu=fiji %s -o %t.o
+; RUN: ld.lld -shared %t.o -o %t.so
+; RUN: llvm-dwarfdump -debug-dump=info %t.so | FileCheck %s
+
+; CHECK: DW_AT_producer [DW_FORM_strp]   ( .debug_str[0x00000000] = "clang version 3.9.0 (trunk 274777)")
+; CHECK: DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000023] = "elf64-dwarf-relocs.cl")
+; CHECK: DW_AT_comp_dir [DW_FORM_strp]   ( .debug_str[0x00000039] = "/home/kzhuravl/Git/Lightning/temp")
+; CHECK: DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000005b] = "elf64_dwarf_relocs")
+; CHECK: DW_AT_decl_file [DW_FORM_data1] ("/home/kzhuravl/Git/Lightning/temp/elf64-dwarf-relocs.cl")
+
+; Function Attrs: norecurse nounwind readnone
+define amdgpu_kernel void @elf64_dwarf_relocs() local_unnamed_addr #0 !dbg !6 !kernel_arg_addr_space !2 !kernel_arg_access_qual !2 !kernel_arg_type !2 !kernel_arg_base_type !2 !kernel_arg_type_qual !2 {
+entry:
+  ret void, !dbg !9
+}
+
+attributes #0 = { norecurse nounwind readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="fiji" "target-features"="+16-bit-insts,+s-memrealtime" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4}
+!llvm.ident = !{!5}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 274777)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
+!1 = !DIFile(filename: "elf64-dwarf-relocs.cl", directory: "/home/kzhuravl/Git/Lightning/temp")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 2}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{!"clang version 3.9.0 (trunk 274777)"}
+!6 = distinct !DISubprogram(name: "elf64_dwarf_relocs", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, variables: !2)
+!7 = !DISubroutineType(types: !8)
+!8 = !{null}
+!9 = !DILocation(line: 1, column: 35, scope: !6)
Index: ELF/Target.cpp
===================================================================
--- ELF/Target.cpp
+++ ELF/Target.cpp
@@ -1424,6 +1424,7 @@
   switch (Type) {
   case R_AMDGPU_GOTPCREL:
   case R_AMDGPU_REL32:
+  case R_AMDGPU_ABS32:
     write32le(Loc, Val);
     break;
   default:
@@ -1433,6 +1434,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.63139.patch
Type: text/x-patch
Size: 2920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160707/c1554b73/attachment.bin>


More information about the llvm-commits mailing list