This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]