[PATCH] D21294: ELF/AMDGPU: Add support for R_AMDGPU_ABS32 relocations

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 09:49:38 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/Target.cpp:1435-1440
@@ -1438,3 +1434,8 @@
                                    uint64_t Val) const {
-  llvm_unreachable("not implemented");
+  switch (Type) {
+  default: llvm_unreachable("do not know how to emit relocation");
+  case R_AMDGPU_REL32:
+    write32le(Loc, Val);
+    break;
+  }
 }
----------------
Then you can make this to

  assert(Type == R_AMDGPU_REL32);
  write32le(Loc, Val);

================
Comment at: ELF/Target.cpp:1444
@@ -1442,3 +1443,3 @@
 RelExpr AMDGPUTargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const {
-  llvm_unreachable("not implemented");
+  return R_PC;
 }
----------------
This runs before relocateOne, so it is better to do error checking here rather than later.

  if (Type == R_AMDGPU_REL32)
    return R_PC;
  error("do not know how to handle relocation");


http://reviews.llvm.org/D21294





More information about the llvm-commits mailing list