What is text.hot section in elf files ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

What is text.hot section in elf files ?

SandeepKsinha
Hello everyone,
While scrolling down the objdump of the code for /usr/bin/gcc, There
is a section called text.hot section, which is normally not present on
the elf files. What is that? is it something specific to /usr/bin/gcc
only.How can be create such sections in our normal executables ?


--
Regards,
Sandeep





A man with one watch knows what time it is; a man with two watches is
never quite sure.
Reply | Threaded
Open this post in threaded view
|

Re: What is text.hot section in elf files ?

Ravi Ramaseshan
Hi,

On 2/6/06, Sandeep Kumar <[hidden email]> wrote:
> Hello everyone,
> While scrolling down the objdump of the code for /usr/bin/gcc, There
> is a section called text.hot section, which is normally not present on
> the elf files. What is that? is it something specific to /usr/bin/gcc
> only.How can be create such sections in our normal executables ?

Seems to be something that gcc generates. Read below:

<snip http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/gcc/Optimize-Options.html>

-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.

    Also profile feedback must be available in to make this option
effective. See -fprofile-arcs for details.

    Enabled at levels -O2, -O3, -Os

</snip>

Cheers,
--
Ravi Ramaseshan
http://www.geocities.com/ramaseshan_ravi/

" Reality is only something we believe in strongly. "