summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-01-03 22:44:58 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-01-03 22:44:58 +0000
commit7c99c1472267e4dfb2edad46555022d98dcd185c (patch)
treeaf1ddc935b29a52172d37d0604dff76aa1b8e10d
parentec0a2fb7037aab3eca8eacdfe85692d3c140a40f (diff)
downloadbcm5719-llvm-7c99c1472267e4dfb2edad46555022d98dcd185c.tar.gz
bcm5719-llvm-7c99c1472267e4dfb2edad46555022d98dcd185c.zip
Use getLocation to improve error message.
llvm-svn: 321768
-rw-r--r--lld/ELF/Relocations.cpp4
-rw-r--r--lld/test/ELF/copy-errors.s9
2 files changed, 9 insertions, 4 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 15403c9c442..4fcec81bce6 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -640,8 +640,8 @@ static RelExpr adjustExpr(Symbol &Sym, RelExpr Expr, RelType Type,
if (Sym.isFunc())
return getPltExpr(Sym, Expr, IsConstant);
- errorOrWarn("symbol '" + toString(Sym) + "' defined in " +
- toString(Sym.File) + " has no type");
+ errorOrWarn("symbol '" + toString(Sym) + "' has no type" +
+ getLocation(S, Sym, RelOff));
return Expr;
}
diff --git a/lld/test/ELF/copy-errors.s b/lld/test/ELF/copy-errors.s
index 0af4638120d..99e6fc09214 100644
--- a/lld/test/ELF/copy-errors.s
+++ b/lld/test/ELF/copy-errors.s
@@ -7,10 +7,15 @@
// CHECK: cannot preempt symbol: bar
// CHECK: >>> defined in {{.*}}.so
// CHECK: >>> referenced by {{.*}}.o:(.text+0x1)
-// CHECK: symbol 'zed' defined in {{.*}}.so has no type
+
+// CHECK: error: symbol 'zed' has no type
+// CHECK-NEXT: >>> defined in {{.*}}.so
+// CHECK-NEXT: >>> referenced by {{.*}}.o:(.text+0x6)
// RUN: not ld.lld --noinhibit-exec %t.o %t2.so -o %t 2>&1 | FileCheck %s --check-prefix=NOINHIBIT
-// NOINHIBIT: warning: symbol 'zed' defined in {{.*}}.so has no type
+// NOINHIBIT: warning: symbol 'zed' has no type
+// NOINHIBIT-NEXT: >>> defined in {{.*}}.so
+// NOINHIBIT-NEXT: >>> referenced by {{.*}}.o:(.text+0x6)
.global _start
_start:
OpenPOWER on IntegriCloud