Fix indentation of:
[deliverable/binutils-gdb.git] / bfd / elf32-spu.c
index 46cc1c69dfb8e5588629ddd2179395ad20415592..e2449d4b8b1beff3c54e6c4f2c995231e989de55 100644 (file)
@@ -367,6 +367,7 @@ struct call_info
   unsigned int max_depth;
   unsigned int is_tail : 1;
   unsigned int is_pasted : 1;
+  unsigned int broken_cycle : 1;
   unsigned int priority : 13;
 };
 
@@ -1013,18 +1014,14 @@ needs_ovl_stub (struct elf_link_hash_entry *h,
   if (spu_elf_section_data (sym_sec->output_section)->u.o.ovl_index
        != spu_elf_section_data (input_section->output_section)->u.o.ovl_index)
     {
-      if (call || sym_type == STT_FUNC)
+      unsigned int lrlive = 0;
+      if (branch)
+       lrlive = (contents[1] & 0x70) >> 4;
+
+      if (!lrlive && (call || sym_type == STT_FUNC))
        ret = call_ovl_stub;
       else
-       {
-         ret = br000_ovl_stub;
-
-         if (branch)
-           {
-             unsigned int lrlive = (contents[1] & 0x70) >> 4;
-             ret += lrlive;
-           }
-       }
+       ret = br000_ovl_stub + lrlive;
     }
 
   /* If this insn isn't a branch then we are possibly taking the
@@ -3271,9 +3268,8 @@ remove_cycles (struct function_info *fun,
                                       "from %s to %s\n"),
                                     f1, f2);
            }
-         *callp = call->next;
-         free (call);
-         continue;
+
+         call->broken_cycle = TRUE;
        }
       callp = &call->next;
     }
@@ -3516,7 +3512,8 @@ mark_overlay_section (struct function_info *fun,
          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;
     }
 
@@ -3576,7 +3573,8 @@ unmark_overlay_section (struct function_info *fun,
     }
 
   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)
@@ -3627,7 +3625,8 @@ collect_lib_sections (struct function_info *fun,
     }
 
   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;
 }
@@ -3821,7 +3820,7 @@ collect_overlays (struct function_info *fun,
 
   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;
@@ -3867,7 +3866,8 @@ collect_overlays (struct function_info *fun,
     }
 
   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)
@@ -3918,6 +3918,8 @@ sum_stack (struct function_info *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))
@@ -3961,7 +3963,7 @@ sum_stack (struct function_info *fun,
        {
          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 ? "*" : " ";
@@ -4842,9 +4844,10 @@ spu_elf_relocate_section (bfd *output_bfd,
 
          for (g = *head; g != NULL; g = g->next)
            if (htab->params->ovly_flavour == ovly_soft_icache
-               ? g->br_addr == (rel->r_offset
-                                + input_section->output_offset
-                                + input_section->output_section->vma)
+               ? (g->ovl == ovl
+                  && g->br_addr == (rel->r_offset
+                                    + input_section->output_offset
+                                    + input_section->output_section->vma))
                : g->addend == addend && (g->ovl == ovl || g->ovl == 0))
              break;
          if (g == NULL)
This page took 0.025133 seconds and 4 git commands to generate.