[PATCH] D21443: Support/ELF: Add AMDGPU relocation definitions to match documentation

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 12:08:34 PDT 2016


tstellarAMD created this revision.
tstellarAMD added reviewers: arsenm, kzhuravl, rafael.
tstellarAMD added a subscriber: llvm-commits.
Herald added a subscriber: kzhuravl.

http://reviews.llvm.org/D21443

Files:
  include/llvm/Support/ELF.h
  include/llvm/Support/ELFRelocs/AMDGPU.def
  lib/Object/ELF.cpp
  lib/ObjectYAML/ELFYAML.cpp

Index: lib/ObjectYAML/ELFYAML.cpp
===================================================================
--- lib/ObjectYAML/ELFYAML.cpp
+++ lib/ObjectYAML/ELFYAML.cpp
@@ -531,6 +531,9 @@
   case ELF::EM_LANAI:
 #include "llvm/Support/ELFRelocs/Lanai.def"
     break;
+  case ELF::EM_AMDGPU:
+#include "llvm/Support/ELFRelocs/AMDGPU.def"
+    break;
   default:
     llvm_unreachable("Unsupported architecture");
   }
Index: lib/Object/ELF.cpp
===================================================================
--- lib/Object/ELF.cpp
+++ lib/Object/ELF.cpp
@@ -105,6 +105,13 @@
       break;
     }
     break;
+  case ELF::EM_AMDGPU:
+    switch (Type) {
+#include "llvm/Support/ELFRelocs/AMDGPU.def"
+    default:
+      break;
+    }
+    break;
   default:
     break;
   }
Index: include/llvm/Support/ELFRelocs/AMDGPU.def
===================================================================
--- /dev/null
+++ include/llvm/Support/ELFRelocs/AMDGPU.def
@@ -0,0 +1,11 @@
+#ifndef ELF_RELOC
+#error "ELF_RELOC must be defined"
+#endif
+
+ELF_RELOC(R_AMDGPU_NONE,          0)
+ELF_RELOC(R_AMDGPU_ABS32_LO,      1)
+ELF_RELOC(R_AMDGPU_ABS32_HI,      2)
+ELF_RELOC(R_AMDGPU_ABS64,         3)
+ELF_RELOC(R_AMDGPU_REL32,         4)
+ELF_RELOC(R_AMDGPU_REL64,         5)
+ELF_RELOC(R_AMDGPU_ABS32,         6)
Index: include/llvm/Support/ELF.h
===================================================================
--- include/llvm/Support/ELF.h
+++ include/llvm/Support/ELF.h
@@ -614,6 +614,11 @@
 #include "ELFRelocs/WebAssembly.def"
 };
 
+// ELF Relocation types for AMDGPU
+enum {
+#include "ELFRelocs/AMDGPU.def"
+};
+
 #undef ELF_RELOC
 
 // Section header.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21443.61008.patch
Type: text/x-patch
Size: 1652 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160616/e7a06e7e/attachment.bin>


More information about the llvm-commits mailing list