This is the mail archive of the
mailing list for the binutils project.
Re: ld -r frustration
On Thu, Jul 29, 2004 at 10:03:39AM +0100, Richard Earnshaw wrote:
> On Thu, 2004-07-29 at 03:31, Alan Modra wrote:
> > Incidentally, one of the nasty effects of ld -r on any arch is the fact
> > that it can reorder code. eg. If compiling with -ffunction-sections,
> > all static functions called "setup" in different files will be grouped
> > into the one section. This loses code locality and can affect cache
> > performance.
> I would expect that to happen on a normal link too.
No, it doesn't, at least not for sections handled by a properly written
linker script. Here's a typical .text output section spec for a final
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */
This places input sections matching .text, .stub, etc. in the same order
as they are found in the linker input. See node "Input Section Basics"
IBM OzLabs - Linux Technology Centre