summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-01-21 02:27:13 +0000
committerAlan Modra <amodra@gmail.com>2009-01-21 02:27:13 +0000
commitfb266b8bce71ad8f875c81a00978578e5ac3874c (patch)
treeaedee562bf6190cb1d0a2dab35b02f4d3a493bcc /bfd
parentf6a96b83ac540c203c92a19e90bfbe61e3a57cc1 (diff)
downloadbinutils-fb266b8bce71ad8f875c81a00978578e5ac3874c.tar.gz
binutils-fb266b8bce71ad8f875c81a00978578e5ac3874c.tar.bz2
binutils-fb266b8bce71ad8f875c81a00978578e5ac3874c.zip
bfd/
* elf32-spu.h (struct spu_elf_params): Add non_ia_text. * elf32-spu.c (mark_overlay_section): Only include .text.ia.* sections in soft-icache lines unless non_ia_text. Don't add rodata if doing so would exceed line size. ld/ * emultempl/spuelf.em (params): Init new field. (OPTION_SPU_NON_IA_TEXT): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add --non-ia-text. (PARSE_AND_LIST_ARGS_CASES): Handle OPTION_SPU_NON_IA_TEXT.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-spu.c28
-rw-r--r--bfd/elf32-spu.h5
3 files changed, 31 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7539164a865..2876ce77d49 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-21 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-spu.h (struct spu_elf_params): Add non_ia_text.
+ * elf32-spu.c (mark_overlay_section): Only include .text.ia.*
+ sections in soft-icache lines unless non_ia_text. Don't add
+ rodata if doing so would exceed line size.
+
2009-01-19 Hans-Peter Nilsson <hp@axis.com>
* elf32-cris.c (elf_cris_copy_indirect_symbol): For other symbol
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index 318c5b4deec..94de8fadf59 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -3279,12 +3279,16 @@ mark_overlay_section (struct function_info *fun,
struct call_info *call;
unsigned int count;
struct _mos_param *mos_param = param;
+ struct spu_link_hash_table *htab = spu_hash_table (info);
if (fun->visit4)
return TRUE;
fun->visit4 = TRUE;
- if (!fun->sec->linker_mark)
+ if (!fun->sec->linker_mark
+ && (htab->params->ovly_flavour != ovly_soft_icache
+ || htab->params->non_ia_text
+ || strncmp (fun->sec->name, ".text.ia.", 9) == 0))
{
unsigned int size;
@@ -3296,7 +3300,8 @@ mark_overlay_section (struct function_info *fun,
this flag to differentiate the two overlay section types. */
fun->sec->flags |= SEC_CODE;
- if (spu_hash_table (info)->params->auto_overlay & OVERLAY_RODATA)
+ size = fun->sec->size;
+ if (htab->params->auto_overlay & OVERLAY_RODATA)
{
char *name = NULL;
@@ -3347,16 +3352,23 @@ mark_overlay_section (struct function_info *fun,
fun->rodata = rodata;
if (fun->rodata)
{
- fun->rodata->linker_mark = 1;
- fun->rodata->gc_mark = 1;
- fun->rodata->flags &= ~SEC_CODE;
+ size += fun->rodata->size;
+ if (htab->params->line_size != 0
+ && size > htab->params->line_size)
+ {
+ size -= fun->rodata->size;
+ fun->rodata = NULL;
+ }
+ else
+ {
+ fun->rodata->linker_mark = 1;
+ fun->rodata->gc_mark = 1;
+ fun->rodata->flags &= ~SEC_CODE;
+ }
}
free (name);
}
}
- size = fun->sec->size;
- if (fun->rodata)
- size += fun->rodata->size;
if (mos_param->max_overlay_size < size)
mos_param->max_overlay_size = size;
}
diff --git a/bfd/elf32-spu.h b/bfd/elf32-spu.h
index 0487d5917df..0e69555364c 100644
--- a/bfd/elf32-spu.h
+++ b/bfd/elf32-spu.h
@@ -1,6 +1,6 @@
/* SPU specific support for 32-bit ELF.
- Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -53,6 +53,9 @@ struct spu_elf_params
/* Set if __stack_* syms will be emitted. */
unsigned int emit_stack_syms : 1;
+ /* Set if non-icache code should be allowed in icache lines. */
+ unsigned int non_ia_text : 1;
+
/* Range of valid addresses for loadable sections. */
bfd_vma local_store_lo;
bfd_vma local_store_hi;