summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Relocations.cpp6
-rw-r--r--lld/test/ELF/copy-errors.s4
2 files changed, 6 insertions, 4 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index ebcb17e3ea9..6aa04443730 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -453,7 +453,8 @@ static RelExpr adjustExpr(const elf::ObjectFile<ELFT> &File, SymbolBody &Body,
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 @@ static RelExpr adjustExpr(const elf::ObjectFile<ELFT> &File, SymbolBody &Body,
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;
}
diff --git a/lld/test/ELF/copy-errors.s b/lld/test/ELF/copy-errors.s
index 0767172919c..5be0aa6ea5f 100644
--- a/lld/test/ELF/copy-errors.s
+++ b/lld/test/ELF/copy-errors.s
@@ -9,7 +9,7 @@ _start:
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
OpenPOWER on IntegriCloud