SPU soft-icache branching to wrong stub

Alan Modra amodra@bigpond.net.au
Sat Jun 6 06:36:00 GMT 2009


Silly me omitted the overlay number check.  Resulted in branching to
the wrong stub when another icache line happened to have a call or
branch at the same address.

	* elf32-spu.c (spu_elf_relocate_section): Match overlay number
	when looking for soft-icache stubs.

Index: bfd/elf32-spu.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-spu.c,v
retrieving revision 1.81
diff -u -p -r1.81 elf32-spu.c
--- bfd/elf32-spu.c	28 May 2009 10:47:44 -0000	1.81
+++ bfd/elf32-spu.c	6 Jun 2009 06:25:37 -0000
@@ -4848,9 +4848,10 @@ spu_elf_relocate_section (bfd *output_bf
 
 	  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)

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list