This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: How to stop --gc-sections nukeing all sections?
- To: ian at zembu dot com (Ian Lance Taylor)
- Subject: Re: How to stop --gc-sections nukeing all sections?
- From: greyham at research dot canon dot com dot au (Graham Stoney)
- Date: Thu, 6 Apr 2000 17:56:44 +1000 (EST)
- Cc: greyham at research dot canon dot com dot au, binutils at sourceware dot cygnus dot com
Ian Lance Taylor writes:
> They also the KEEP command to retain special sections, such as those
> holding initialization code for global constructors.
Aha! It's the old undocumented ld script command trick! Thanks Chief!
The only problem now is that the linker is _reversing the order_ of all the
functions (each in its own .text.* section, thanks to -ffunction-sections)
from the order in my .c file when it writes them to the output!
For example, arch/ppc/kernel/process.c has functions in the order:
kernel_stack_top
task_top
dump_fpu
enable_kernel_fp
etc
But in the output map, they're in the order:
etc
c00077a8 T enable_kernel_fp
c00077d0 T dump_fpu
c0007820 T task_top
c0007828 T kernel_stack_top
Would any binutils gurus care to speculate on what could cause the linker to
swap the order of functions like this? I'm so close... and yet so far...
Thanks,
Graham