This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Sort input section by list
Why not have a tool dedicated to this kind of optimization?
For one of our targets, we have developed a post linker tool which
reorders functions based on call graph analysis.
cool! is this downloadable somewhere ? ;)
Not currently.
If the purpose is really to reorder functions, why should the
developer need to deal with sections? (I mean, not all developers
master the concept of section, do they?)
this is what -ffunction-sections is for
I always forget about this option :-)
there are some complications like.. does the linker know what the end of
a function is?
It relies on the size attribute of the function symbol. This means that
the compiler adds the proper .size directives (and that assembly
developers do so, too).
With tail packing but without sections.. I kind of fear the answer to be
"no" ;(
Could you give me an example? Do you mean merging tails of two functions?
If the compiler is able to do that, I guess it is able to write the
appropriate directives :-)
Note that we have also added a "moveable" attribute to symbols, so that
we can also force some functions not to be moved.
Christophe.