[llvm] r192996 - Check for errors when calling lto_codegen_add_module in the gold plugin.
Rafael Espindola
rafael.espindola at gmail.com
Fri Oct 18 12:32:06 PDT 2013
Author: rafael
Date: Fri Oct 18 14:32:06 2013
New Revision: 192996
URL: http://llvm.org/viewvc/llvm-project?rev=192996&view=rev
Log:
Check for errors when calling lto_codegen_add_module in the gold plugin.
Thanks to Milan LenĨo for noticing it.
Modified:
llvm/trunk/tools/gold/gold-plugin.cpp
Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=192996&r1=192995&r2=192996&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Fri Oct 18 14:32:06 2013
@@ -351,8 +351,13 @@ static ld_plugin_status claim_file_hook(
}
}
- 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);
More information about the llvm-commits
mailing list