[PATCH] LTO: Error out for missing function body
Andi Kleen
andi@firstfloor.org
Thu Jul 15 13:12:00 GMT 2010
LTO: Error out for missing function body
When the linker is confused in WHOPR mode and passes incorrect resolution files
lto1 could eventually crash when it sees a PREVAILING_DEF_IRONLY with missing body.
Error out early when this happens and print the function name.
2010-07-15 Andi Kleen <ak@linux.intel.com>
* lto-symtab (lto_symtab_resolve_symbols): Error out for missing
function body with a prevailing IR definition.
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index 6eaf22c..864587f 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -492,7 +492,13 @@ lto_symtab_resolve_symbols (void **slot)
for (e = (lto_symtab_entry_t) *slot; e; e = e->next)
{
if (TREE_CODE (e->decl) == FUNCTION_DECL)
- e->node = cgraph_get_node_or_alias (e->decl);
+ {
+ e->node = cgraph_get_node_or_alias (e->decl);
+ if (e->resolution == LDPR_PREVAILING_DEF_IRONLY &&
+ e->node == NULL)
+ fatal_error ("prevailing def ironly function decl node without body %qE",
+ e->decl);
+ }
else if (TREE_CODE (e->decl) == VAR_DECL)
{
e->vnode = varpool_get_node (e->decl);
More information about the Gcc-patches
mailing list