This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
hot/cold section support
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org
- Date: Fri, 4 Sep 2009 16:06:11 +0930
- Subject: hot/cold section support
This causes ld to group cold text sections together for better cache
locality. I chose to put them before other text sections because this
places the cold sections next to .init and a number of targets
generate stubs placed at the end of .text. Also, placing cold
sections at the end of .text would require non-trivial changes to
section name matching. (You'd need to be able to say "match .text.*
but not .text.*_unlikely".)
I'll leave updating other ELF scripts to their respective maintainers.
* scripttempl/elf.sc (.text): Add cold text sections.
Index: ld/scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.94
diff -u -p -r1.94 elf.sc
--- ld/scripttempl/elf.sc 1 Sep 2009 02:54:10 -0000 1.94
+++ ld/scripttempl/elf.sc 3 Sep 2009 15:28:06 -0000
@@ -410,6 +410,7 @@ cat <<EOF
.text ${RELOCATING-0} :
{
${RELOCATING+${TEXT_START_SYMBOLS}}
+ ${RELOCATING+*(.text.unlikely .text.*_unlikely)}
*(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
--
Alan Modra
Australia Development Lab, IBM