+2009-05-28 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * elf32-spu.c (struct call_info): New member broken_cycle.
+ (remove_cycle): Instead of physically removing call_info structures
+ to break call graph cycles, mark them using the broken_cycle flag.
+ (mark_overlay_section): Respect broken_cycle flag.
+ (unmark_overlay_section): Likewise.
+ (collect_lib_sections): Likewise.
+ (collect_overlays): Likewise.
+ (sum_stack): Likewise.
+
2009-05-28 Ulrich Weigand <uweigand@de.ibm.com>
* elf32-spu.c (insert_callee): Accumulate incoming callee->count.
unsigned int max_depth;
unsigned int is_tail : 1;
unsigned int is_pasted : 1;
+ unsigned int broken_cycle : 1;
unsigned int priority : 13;
};
"from %s to %s\n"),
f1, f2);
}
- *callp = call->next;
- free (call);
- continue;
+
+ call->broken_cycle = TRUE;
}
callp = &call->next;
}
BFD_ASSERT (!fun->sec->segment_mark);
fun->sec->segment_mark = 1;
}
- if (!mark_overlay_section (call->fun, info, param))
+ if (!call->broken_cycle
+ && !mark_overlay_section (call->fun, info, param))
return FALSE;
}
}
for (call = fun->call_list; call != NULL; call = call->next)
- if (!unmark_overlay_section (call->fun, info, param))
+ if (!call->broken_cycle
+ && !unmark_overlay_section (call->fun, info, param))
return FALSE;
if (RECURSE_UNMARK)
}
for (call = fun->call_list; call != NULL; call = call->next)
- collect_lib_sections (call->fun, info, param);
+ if (!call->broken_cycle)
+ collect_lib_sections (call->fun, info, param);
return TRUE;
}
fun->visit7 = TRUE;
for (call = fun->call_list; call != NULL; call = call->next)
- if (!call->is_pasted)
+ if (!call->is_pasted && !call->broken_cycle)
{
if (!collect_overlays (call->fun, info, ovly_sections))
return FALSE;
}
for (call = fun->call_list; call != NULL; call = call->next)
- if (!collect_overlays (call->fun, info, ovly_sections))
+ if (!call->broken_cycle
+ && !collect_overlays (call->fun, info, ovly_sections))
return FALSE;
if (added_fun)
max = NULL;
for (call = fun->call_list; call; call = call->next)
{
+ if (call->broken_cycle)
+ continue;
if (!call->is_pasted)
has_call = TRUE;
if (!sum_stack (call->fun, info, sum_stack_param))
{
info->callbacks->minfo (_(" calls:\n"));
for (call = fun->call_list; call; call = call->next)
- if (!call->is_pasted)
+ if (!call->is_pasted && !call->broken_cycle)
{
const char *f2 = func_name (call->fun);
const char *ann1 = call->fun == max ? "*" : " ";