SPU icache symbol fix
Alan Modra
amodra@bigpond.net.au
Mon May 11 09:40:00 GMT 2009
I'm committing this patch from Ulrich to fix ABI defined symbols,
and to cure errors found when using .ovl.init, which occupies the
icache buffer but isn't an overlay so does not delimit the start
of overlay LMAs.
* elf32-spu.c (spu_elf_find_overlays): Don't use .ovl.init lma as
start of overlays.
(spu_elf_build_stubs): Don't define __icache_tagbase. Define
__icache_tag_array and __icache_tag_array_size.
Index: bfd/elf32-spu.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-spu.c,v
retrieving revision 1.69
diff -u -p -r1.69 elf32-spu.c
--- bfd/elf32-spu.c 19 Mar 2009 07:04:11 -0000 1.69
+++ bfd/elf32-spu.c 11 May 2009 09:27:22 -0000
@@ -657,7 +657,10 @@ spu_elf_find_overlays (struct bfd_link_i
{
asection *s0 = alloc_sec[i - 1];
vma_start = s0->vma;
- lma_start = s0->lma;
+ if (strncmp (s0->name, ".ovl.init", 9) != 0)
+ lma_start = s0->lma;
+ else
+ lma_start = s->lma;
ovl_end = (s0->vma
+ ((bfd_vma) 1
<< (htab->num_lines_log2 + htab->line_size_log2)));
@@ -1938,12 +1941,19 @@ spu_elf_build_stubs (struct bfd_link_inf
{
bfd_vma off, icache_base, linklist;
- h = define_ovtab_symbol (htab, "__icache_tagbase");
+ h = define_ovtab_symbol (htab, "__icache_tag_array");
if (h == NULL)
return FALSE;
h->root.u.def.value = 0;
h->size = 16 << htab->num_lines_log2;
off = h->size;
+
+ h = define_ovtab_symbol (htab, "__icache_tag_array_size");
+ if (h == NULL)
+ return FALSE;
+ h->root.u.def.value = 16 << htab->num_lines_log2;
+ h->root.u.def.section = bfd_abs_section_ptr;
+
icache_base = htab->ovl_sec[0]->vma;
linklist = (htab->ovtab->output_section->vma
+ htab->ovtab->output_offset
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list