summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-02-13 01:39:32 +0000
committerReid Kleckner <rnk@google.com>2019-02-13 01:39:32 +0000
commitafe1e3e6694e117e25471f4958b53e805f6ddff6 (patch)
tree278a7dd84f0d337914b7dff6ef4b74378644c26a /llvm/lib/MC/ELFObjectWriter.cpp
parent63e2e59b89f0232f0366f0f67d0e67a67eea423b (diff)
downloadbcm5719-llvm-afe1e3e6694e117e25471f4958b53e805f6ddff6.tar.gz
bcm5719-llvm-afe1e3e6694e117e25471f4958b53e805f6ddff6.zip
[MC] Make symbol version errors non-fatal
We stil don't have a source location, which is pretty lame, but at least we won't tell the user to file a clang bug report anymore. Fixes PR40712 llvm-svn: 353907
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index b118fe69d95..9cae28128c9 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1274,14 +1274,20 @@ void ELFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
if (!Symbol.isUndefined() && !Rest.startswith("@@@"))
continue;
- // FIXME: produce a better error message.
+ // FIXME: Get source locations for these errors or diagnose them earlier.
if (Symbol.isUndefined() && Rest.startswith("@@") &&
- !Rest.startswith("@@@"))
- report_fatal_error("A @@ version cannot be undefined");
+ !Rest.startswith("@@@")) {
+ Asm.getContext().reportError(SMLoc(), "versioned symbol " + AliasName +
+ " must be defined");
+ continue;
+ }
- if (Renames.count(&Symbol) && Renames[&Symbol] != Alias)
- report_fatal_error(llvm::Twine("Multiple symbol versions defined for ") +
- Symbol.getName());
+ if (Renames.count(&Symbol) && Renames[&Symbol] != Alias) {
+ Asm.getContext().reportError(
+ SMLoc(), llvm::Twine("multiple symbol versions defined for ") +
+ Symbol.getName());
+ continue;
+ }
Renames.insert(std::make_pair(&Symbol, Alias));
}
OpenPOWER on IntegriCloud