This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Map ".text.hot" and ".text.unlikely" input section prefixes to separate output sections.
- From: Cary Coutant <ccoutant at google dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, Sriraman Tallam <tmsriram at google dot com>, binutils <binutils at sourceware dot org>
- Date: Mon, 15 Jul 2013 10:57:20 -0700
- Subject: Re: Map ".text.hot" and ".text.unlikely" input section prefixes to separate output sections.
- References: <CAAs8HmygtSkVh3v4dz2hBTzS1AH-rLbBkTDJ-hVkzENC2sqQZg at mail dot gmail dot com> <mcrlitsdqf3 dot fsf at coign dot corp dot google dot com> <CAAs8HmxS9v50Bzw1srgUaC+8dCekCjv_H5_kyAi3Z5TDB8TkGg at mail dot gmail dot com> <CAKOQZ8zm-uHvKBm-DaSA99TTuzob0+XV8NkLM82BJ4VdS7aYHw at mail dot gmail dot com> <20121119225222 dot GK3056 at bubble dot grove dot modra dot org> <CAKOQZ8zoxKijcBbM583845u4vtW29dxFZVyZt1U+f_p1B6GJWg at mail dot gmail dot com> <20121120020352 dot GP3056 at bubble dot grove dot modra dot org> <CAMe9rOrnF2-FvGFh0TJHaEdJG0Di5HBJ73i2wcNt1mkFCXZQdQ at mail dot gmail dot com>
>>> Unfortunately it leaves us adding more special cases for section
>>> names, which I really dislike. Is there any happy medium?
>>
>> I understand the dislike, but I don't see an alternative. We should
>> have spoken up before the hot/cold support was added to gcc. I also
>> dislike the fact that -ffunction-sections can generate section names
>> that match the names chosen for hot/cold sections.
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24201
Is it truly too late to fix this? It would help to have a more
rigorous way of naming these sections. I'd like to modify HJ's old
idea from that PR slightly, and suggest a naming scheme like this when
-ffunction-sections is on:
.text.class.function
Where "class" can be "hot", "unlikely", "startup", "exit", or just the
empty string. With -ffunction-sections off, the ".function" would be
omitted and names would look like they do now. (The same scheme can be
applied to ".data" and other sections.)
The linkers would assign input sections to output sections by the
first component, group input sections within the output section by the
second component, and ignore the third component (with the option to
provide explicit section reordering options based on the full input
section name).
-cary