summaryrefslogtreecommitdiffstats
path: root/llvm/tools/gold/gold-plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/gold/gold-plugin.cpp')
-rw-r--r--llvm/tools/gold/gold-plugin.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index 8ebae0e498c..2d50f49ffd7 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -482,8 +482,11 @@ static GlobalObject *makeInternalReplacement(GlobalObject *GO) {
Module *M = GO->getParent();
GlobalObject *Ret;
if (auto *F = dyn_cast<Function>(GO)) {
- if (F->isMaterializable())
- F->Materialize();
+ if (F->isMaterializable()) {
+ if (std::error_code EC = F->materialize())
+ message(LDPL_FATAL, "LLVM gold plugin has failed to read a function");
+
+ }
auto *NewF = Function::Create(F->getFunctionType(), F->getLinkage(),
F->getName(), M);
OpenPOWER on IntegriCloud