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]

[commit] SPU i-cache: Allow .init and .fini in the i-cache


Hello,

as the linker will now by default only move sections called .text.ia....
into the icache, this leaves out .init and .fini.  This is a bit
unfortunate as those sections are used only once and therefore real good
candidates for the icache.  However, they cannot really be renamed
without ABI breakage.  The following patch simply special-codes .init and
.fini and put them into the icache as well.

Note that this imposes the requirement that code in those sections must
conform to the icache rules.  However, .init/.fini contents are typically
quite simply (just a list of direct function calls) and already satisfies
those rules ...

Tested on spu-elf with no regressions.
Approved off-line by Alan Modra; committed to mainline.

Bye,
Ulrich


ChangeLog:

	* elf32-spu.c (mark_overlay_section): Move .init and .fini
	sections into the software icache.

diff -urNp src.orig/bfd/elf32-spu.c src/bfd/elf32-spu.c
--- src.orig/bfd/elf32-spu.c	2009-05-12 14:31:36.000000000 +0200
+++ src/bfd/elf32-spu.c	2009-05-12 14:32:49.000000000 +0200
@@ -3390,7 +3390,9 @@ mark_overlay_section (struct function_in
   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))
+	  || strncmp (fun->sec->name, ".text.ia.", 9) == 0
+	  || strcmp (fun->sec->name, ".init") == 0
+	  || strcmp (fun->sec->name, ".fini") == 0))
     {
       unsigned int size;
 
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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