diff options
author | Alan Modra <amodra@bigpond.net.au> | 2008-08-04 13:01:42 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2008-08-04 13:01:42 +0000 |
commit | 857c84eb32cc356d89a3bc4de4028d19a843c3e6 (patch) | |
tree | 81db4b86ac28e3ba4045e8e445455ae4ed941277 /bfd/elf32-spu.c | |
parent | 7bf89d4175decca818500c7815a69f4a1353841b (diff) | |
download | binutils-redhat-857c84eb32cc356d89a3bc4de4028d19a843c3e6.tar.gz |
* 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.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c index 3a5728b420..17ff079c0c 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 |