summaryrefslogtreecommitdiff
path: root/bfd/elf32-spu.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2009-05-14 04:30:03 +0000
committerAlan Modra <amodra@bigpond.net.au>2009-05-14 04:30:03 +0000
commit6786da5e182e0d9e987c3c0ef4aa20072a99ba4c (patch)
tree8bc15b8649280c76954a8f82124fefc8fb2d4b8e /bfd/elf32-spu.c
parentae045fc9f2f0b19ab7cda47fce90b21e2657a339 (diff)
downloadbinutils-redhat-6786da5e182e0d9e987c3c0ef4aa20072a99ba4c.tar.gz
bfd/
* elf32-spu.c (spu_elf_size_stubs): Split out section placement to.. (spu_elf_place_overlay_data): ..here. New function. * elf32-spu.h (spu_elf_place_overlay_data): Declare. ld/ * emultempl/spuelf.em (spu_before_allocation): Call spu_elf_place_overlay_data. ld/testsuite/ * ld-spu/icache1.d: Update for changed overlay manager placement. * ld-spu/ovl.d: Likewise. * ld-spu/ovl2.d: Likewise.
Diffstat (limited to 'bfd/elf32-spu.c')
-rw-r--r--bfd/elf32-spu.c44
1 files changed, 35 insertions, 9 deletions
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index fab3139f2e..06091f3f90 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -1660,7 +1660,6 @@ spu_elf_size_stubs (struct bfd_link_info *info)
flagword flags;
unsigned int i;
asection *stub;
- const char *ovout;
if (!process_stubs (info, FALSE))
return 0;
@@ -1691,7 +1690,6 @@ spu_elf_size_stubs (struct bfd_link_info *info)
if (htab->params->ovly_flavour == ovly_soft_icache)
/* Extra space for linked list entries. */
stub->size += htab->stub_count[0] * 16;
- (*htab->params->place_spu_section) (stub, NULL, ".text");
for (i = 0; i < htab->num_overlays; ++i)
{
@@ -1704,7 +1702,6 @@ spu_elf_size_stubs (struct bfd_link_info *info)
ovl_stub_size_log2 (htab->params)))
return 0;
stub->size = htab->stub_count[ovl] * ovl_stub_size (htab->params);
- (*htab->params->place_spu_section) (stub, osec, NULL);
}
flags = (SEC_ALLOC | SEC_LOAD
@@ -1728,7 +1725,6 @@ spu_elf_size_stubs (struct bfd_link_info *info)
return 0;
htab->init->size = 16;
- (*htab->params->place_spu_section) (htab->init, NULL, ".ovl.init");
}
else
{
@@ -1747,21 +1743,51 @@ spu_elf_size_stubs (struct bfd_link_info *info)
htab->ovtab->size = htab->num_overlays * 16 + 16 + htab->num_buf * 4;
}
- ovout = ".data";
- if (htab->params->ovly_flavour == ovly_soft_icache)
- ovout = ".data.icache";
- (*htab->params->place_spu_section) (htab->ovtab, NULL, ovout);
htab->toe = bfd_make_section_anyway_with_flags (ibfd, ".toe", SEC_ALLOC);
if (htab->toe == NULL
|| !bfd_set_section_alignment (ibfd, htab->toe, 4))
return 0;
htab->toe->size = htab->params->ovly_flavour == ovly_soft_icache ? 256 : 16;
- (*htab->params->place_spu_section) (htab->toe, NULL, ".toe");
return 2;
}
+/* Called from ld to place overlay manager data sections. This is done
+ after the overlay manager itself is loaded, mainly so that the
+ linker's htab->init section is placed after any other .ovl.init
+ sections. */
+
+void
+spu_elf_place_overlay_data (struct bfd_link_info *info)
+{
+ struct spu_link_hash_table *htab = spu_hash_table (info);
+ unsigned int i;
+ const char *ovout;
+
+ if (htab->stub_count == NULL)
+ return;
+
+ (*htab->params->place_spu_section) (htab->stub_sec[0], NULL, ".text");
+
+ for (i = 0; i < htab->num_overlays; ++i)
+ {
+ asection *osec = htab->ovl_sec[i];
+ unsigned int ovl = spu_elf_section_data (osec)->u.o.ovl_index;
+ (*htab->params->place_spu_section) (htab->stub_sec[ovl], osec, NULL);
+ }
+
+ if (htab->params->ovly_flavour == ovly_soft_icache)
+ (*htab->params->place_spu_section) (htab->init, NULL, ".ovl.init");
+
+ ovout = ".data";
+ if (htab->params->ovly_flavour == ovly_soft_icache)
+ ovout = ".data.icache";
+ (*htab->params->place_spu_section) (htab->ovtab, NULL, ovout);
+
+ (*htab->params->place_spu_section) (htab->toe, NULL, ".toe");
+}
+
/* Functions to handle embedded spu_ovl.o object. */
static void *