[PATCH] D26738: [ELF] - Improve diagnostic messages.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 09:33:52 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL287120: [ELF] - Improve diagnostic messages. (authored by grimar).

Changed prior to commit:
  https://reviews.llvm.org/D26738?vs=78155&id=78203#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26738

Files:
  lld/trunk/ELF/Relocations.cpp
  lld/trunk/test/ELF/copy-errors.s


Index: lld/trunk/test/ELF/copy-errors.s
===================================================================
--- lld/trunk/test/ELF/copy-errors.s
+++ lld/trunk/test/ELF/copy-errors.s
@@ -9,7 +9,7 @@
 
 
 call bar
-// CHECK: cannot preempt symbol bar
+// CHECK: {{.*}}.o (.text+0x1): cannot preempt symbol 'bar' previously defined in {{.*}}.so
 
 call zed
-// CHECK: symbol zed is missing type
+// CHECK: symbol 'zed' defined in {{.*}}.so is missing type
Index: lld/trunk/ELF/Relocations.cpp
===================================================================
--- lld/trunk/ELF/Relocations.cpp
+++ lld/trunk/ELF/Relocations.cpp
@@ -453,7 +453,8 @@
     return Expr;
   }
   if (Body.getVisibility() != STV_DEFAULT) {
-    error("cannot preempt symbol " + Body.getName());
+    error(getLocation(S, RelOff) + ": cannot preempt symbol '" +
+          Body.getName() + "' previously defined in " + getFilename(Body.File));
     return Expr;
   }
   if (Body.isObject()) {
@@ -487,7 +488,8 @@
     Body.NeedsCopyOrPltAddr = true;
     return toPlt(Expr);
   }
-  error("symbol " + Body.getName() + " is missing type");
+  error("symbol '" + Body.getName() + "' defined in " + getFilename(Body.File) +
+        " is missing type");
 
   return Expr;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26738.78203.patch
Type: text/x-patch
Size: 1246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161116/e3d86ead/attachment.bin>


More information about the llvm-commits mailing list