summaryrefslogtreecommitdiff
path: root/bfd/elf32-spu.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-08-04 13:01:42 +0000
committerAlan Modra <amodra@gmail.com>2008-08-04 13:01:42 +0000
commite5e6a5ff6ea89e1f8627d16d492288e0b8e834b1 (patch)
tree2ddc24a9ac2046750d4c5f10ef9d1182f405d553 /bfd/elf32-spu.c
parent413a266c4f0c55f4946c249ee3c91f6c0cea9e08 (diff)
downloadbinutils-e5e6a5ff6ea89e1f8627d16d492288e0b8e834b1.tar.gz
binutils-e5e6a5ff6ea89e1f8627d16d492288e0b8e834b1.tar.bz2
binutils-e5e6a5ff6ea89e1f8627d16d492288e0b8e834b1.zip
* elf32-spu.c (spu_elf_auto_overlay): Use the maximum possible
if --fixed-space request is too large.
Diffstat (limited to 'bfd/elf32-spu.c')
-rw-r--r--bfd/elf32-spu.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index 3a5728b4204..17ff079c0cc 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -3608,14 +3608,18 @@ spu_elf_auto_overlay (struct bfd_link_info *info,
(bfd_vma) mos_param.max_overlay_size);
/* Now see if we should put some functions in the non-overlay area. */
- if (fixed_size < htab->overlay_fixed
- && htab->overlay_fixed + mos_param.max_overlay_size < htab->local_store)
+ else if (fixed_size < htab->overlay_fixed)
{
- unsigned int lib_size = htab->overlay_fixed - fixed_size;
+ unsigned int max_fixed, lib_size;
+
+ max_fixed = htab->local_store - mos_param.max_overlay_size;
+ if (max_fixed > htab->overlay_fixed)
+ max_fixed = htab->overlay_fixed;
+ lib_size = max_fixed - fixed_size;
lib_size = auto_ovl_lib_functions (info, lib_size);
if (lib_size == (unsigned int) -1)
goto err_exit;
- fixed_size = htab->overlay_fixed - lib_size;
+ fixed_size = max_fixed - lib_size;
}
/* Build an array of sections, suitably sorted to place into