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]

[PATCH] Group .text.exit, text.startup and .text.hot sections


Hi,
GCC was for a while splitting functions into .text.unlikely and .text.hot with
profile feedback and was recently updated to do so by default in some cases.
Also new subsections was added for functions executed at startup and exit
only (static constructors+main() and static destructors).  This makes important
difference for C++ startup times.

GCC also used to add _ulinkely suffix to named sections that is probably reason
for the .text.*_unlikely rule.  I removed it now and we will produce
.text.unlikely.function_name sections for -ffunction-sections and do nothing
for explicitely named sections.  Perhaps eventually the _unlikely rule can be
dropped. There is some risk for random matches with function names.

This patch updates default linker script to handle these sections. OK?  Gold
will also need update, I am not sure if I can do that myself but will check ;)

Honza

	* scripttempl/elf.sc: Group .text.exit, text.shartup and .text.hot
	subsections.
Index: ld/scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.103
diff -c -p -r1.103 elf.sc
*** ld/scripttempl/elf.sc	29 Oct 2010 12:10:37 -0000	1.103
--- ld/scripttempl/elf.sc	23 Nov 2010 16:18:31 -0000
*************** cat <<EOF
*** 433,438 ****
--- 433,441 ----
    {
      ${RELOCATING+${TEXT_START_SYMBOLS}}
      ${RELOCATING+*(.text.unlikely .text.*_unlikely)}
+     ${RELOCATING+*(.text.exit .text.exit.*}
+     ${RELOCATING+*(.text.startup .text.startup.*}
+     ${RELOCATING+*(.text.hot .text.hot.*}
      *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
      /* .gnu.warning sections are handled specially by elf32.em.  */
      *(.gnu.warning)


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