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]

Linker support for -freorder-functions?


This patch

http://gcc.gnu.org/ml/gcc-patches/2002-05/msg00973.html

added

`-freorder-functions'
     Reorder basic blocks in the compiled function in order to reduce
     number of taken branches and improve code locality. This is
     implemented by using special subsections `text.hot' for most
     frequently executed functions and `text.unlikely' for unlikely
     executed functions.  Reordering is done by the linker so object
     file format must support named sections and linker must place them
     in a reasonable way.

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)


Also, should section names be .text.hot/.text.unlikely instead of
text.hot/text.unlikely?


H.J.


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