This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] LTO: Error out for missing function body

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  <>

	* 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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]