This is the mail archive of the binutils@sources.redhat.com 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: Linker support for -freorder-functions?


On Thu, Aug 05, 2004 at 03:02:27PM -0700, Mike Stump wrote:
> On Aug 5, 2004, at 1:58 PM, H. J. Lu wrote:
> >But it is useless without linker support. Should linker group
> >text.hot/text.unlikely like
> >
> >*(.text.hot)
> >*(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
> >KEEP (*(.text.*personality*))
> >*(.text.unlikely)
> 
> Seems almost reasonable from my humble perspective...

No, it wouldn't work.  .text.unlikely would match in .text.*

>  though, hot 
> would be all together in the .text.* area...  so, listing it first 
> isn't strictly necessary....  and, likewise, unlikely would tend to 
> group together as well, so strictly speaking, listing it last should 
> not be necessary...

This isn't completely correct.  .text.hot and .text.unlikely will appear
in the order they occur in input files.  You'll only group functions'
.text.hot sections together by virtue of the assembler using the same
section in one file.  See node "Input Section Basics" in the ld info
doc, para starting "There are two ways to include.."

> The change might be wrong from a {non-,}RELOCATING perspective, a 

Agreed.  You want

    ${RELOCATING+*(.text.hot) *(.text.unlikely)}
    *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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