This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Group static constructors and destructors in specific subsections
- From: Alan Modra <amodra at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: binutils at sourceware dot org
- Date: Thu, 21 Oct 2010 18:49:46 +1030
- Subject: Re: Group static constructors and destructors in specific subsections
- References: <20101014203817.GB15487@kam.mff.cuni.cz>
On Thu, Oct 14, 2010 at 10:38:17PM +0200, Jan Hubicka wrote:
> * scripttempl/elf.sf: Group exit, startup and hot sections, too.
> Index: ld/scripttempl/elf.sc
> ===================================================================
> RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
> retrieving revision 1.102
> diff -c -p -r1.102 elf.sc
> *** ld/scripttempl/elf.sc 23 Mar 2010 16:02:02 -0000 1.102
> --- ld/scripttempl/elf.sc 14 Oct 2010 20:09:46 -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)
Perhaps slightly better ordered as
> + ${RELOCATING+*(.text.startup .text.*_startup)}
> + ${RELOCATING+*(.text.exit .text.*_exit)}
> ${RELOCATING+*(.text.unlikely .text.*_unlikely)}
> + ${RELOCATING+*(.text.hot .text.*_hot)}
Startup and exit code should see even less use than .text.unlikely,
and this way startup code is closer to .init. Please apply so this
goes into the 2.21 release. (If I've missed something in suggesting a
different order, then your original patch is OK too.)
--
Alan Modra
Australia Development Lab, IBM