Skip to content

Commit

Permalink
Check for errors when calling lto_codegen_add_module in the gold plugin.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
espindola committed Oct 18, 2013
1 parent 3c58aad commit 2d8a1d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/gold/gold-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2d8a1d6

Please sign in to comment.