summaryrefslogtreecommitdiff
path: root/tools/gold/gold-plugin.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-18 19:32:06 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-18 19:32:06 +0000
commit2d8a1d677c81c8e05d1dbc7832e1ced10cfc629a (patch)
tree7d4d339f029b1cd3cc5eee25f044403ed9d5af33 /tools/gold/gold-plugin.cpp
parent3c58aad3bc10f888c08c82520ea5b6f629fb91ba (diff)
downloadllvm-2d8a1d677c81c8e05d1dbc7832e1ced10cfc629a.tar.gz
llvm-2d8a1d677c81c8e05d1dbc7832e1ced10cfc629a.tar.bz2
llvm-2d8a1d677c81c8e05d1dbc7832e1ced10cfc629a.tar.xz
Check for errors when calling lto_codegen_add_module in the gold plugin.
Thanks to Milan LenĨo for noticing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192996 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gold/gold-plugin.cpp')
-rw-r--r--tools/gold/gold-plugin.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp
index 826173938a..360ec07e79 100644
--- a/tools/gold/gold-plugin.cpp
+++ b/tools/gold/gold-plugin.cpp
@@ -351,8 +351,13 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
}
}
- if (code_gen)
- lto_codegen_add_module(code_gen, M);
+ if (code_gen) {
+ if (lto_codegen_add_module(code_gen, M)) {
+ (*message)(LDPL_ERROR, "Error linking module: %s",
+ lto_get_error_message());
+ return LDPS_ERR;
+ }
+ }
lto_module_dispose(M);