This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

SPU --auto-overlay bug


Not initializing broken_cycle led to broken call graphs if your
malloc'd memory was dirty, and some traversals could miss nodes.  This
showed up as a fail of the ld icache1 test.

	* elf32-spu.c (mark_functions_via_relocs): Init broken_cycle field
	of malloc'd struct call_info.
	(pasted_function): Likewise, priority too.

Index: bfd/elf32-spu.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-spu.c,v
retrieving revision 1.84
diff -u -p -r1.84 elf32-spu.c
--- bfd/elf32-spu.c	7 Jul 2009 03:26:47 -0000	1.84
+++ bfd/elf32-spu.c	9 Jul 2009 10:49:16 -0000
@@ -2785,6 +2785,7 @@ mark_functions_via_relocs (asection *sec
 	return FALSE;
       callee->is_tail = !is_call;
       callee->is_pasted = FALSE;
+      callee->broken_cycle = FALSE;
       callee->priority = priority;
       callee->count = 1;
       if (callee->fun->last_caller != sec)
@@ -2878,6 +2879,8 @@ pasted_function (asection *sec)
 	      callee->fun = fun;
 	      callee->is_tail = TRUE;
 	      callee->is_pasted = TRUE;
+	      callee->broken_cycle = FALSE;
+	      callee->priority = 0;
 	      callee->count = 1;
 	      if (!insert_callee (fun_start, callee))
 		free (callee);

-- 
Alan Modra
Australia Development Lab, IBM


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