[PATCH] D23690: [ELF] Improve error reporting for relocations

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 12:24:48 PDT 2016


ruiu added a comment.

Thank you for doing this!


================
Comment at: ELF/Relocations.cpp:425-430
@@ -424,4 +424,8 @@
   if (Config->Shared || (Config->Pic && !isRelExpr(Expr))) {
-    error("can't create dynamic relocation " + getRelName(Type) +
-          " against readonly segment");
+    if (!Body.isLocal())
+      error("can't create dynamic relocation " + getRelName(Type) +
+            " against symbol " + Body.getName());
+    else
+      error("can't create dynamic relocation " + getRelName(Type) +
+            " against readonly segment");
     return Expr;
----------------
You can call getName() on a local symbol, can't you?


https://reviews.llvm.org/D23690





More information about the llvm-commits mailing list