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]

Re: Group static constructors and destructors in specific subsections


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


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