This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Improve spu --fixed-space
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org
- Date: Mon, 4 Aug 2008 22:32:53 +0930
- Subject: Improve spu --fixed-space
Improves the behaviour of --fixed-space. Previously, ld wouldn't try
to put any frequently used functions in the non-overlay area if the
--fixed-space argument exceeded actual space available. Now we put as
much as possible.
* elf32-spu.c (spu_elf_auto_overlay): Use the maximum possible
if --fixed-space request is too large.
Index: bfd/elf32-spu.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-spu.c,v
retrieving revision 1.50
diff -u -p -r1.50 elf32-spu.c
--- bfd/elf32-spu.c 2 Aug 2008 06:44:43 -0000 1.50
+++ bfd/elf32-spu.c 4 Aug 2008 03:41:36 -0000
@@ -3608,14 +3608,18 @@ spu_elf_auto_overlay (struct bfd_link_in
(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
--
Alan Modra
Australia Development Lab, IBM