This is the mail archive of the
mailing list for the binutils project.
Re: Some extensions to the .section directive for ELF and COFF
- From: Alan Modra <amodra at gmail dot com>
- To: Rafael Espíndola <rafael dot espindola at gmail dot com>
- Cc: dvalin at internode dot on dot net, Binutils <binutils at sourceware dot org>, Cary Coutant <ccoutant at google dot com>
- Date: Sat, 28 Mar 2015 22:53:51 +1030
- Subject: Re: Some extensions to the .section directive for ELF and COFF
- Authentication-results: sourceware.org; auth=none
- References: <CAG3jReLKTfN_o1x7_jpMDVzMHemmx9K9P4-yU4qNLm2xtPpd+Q at mail dot gmail dot com> <20150326015631 dot GT26234 at bubble dot grove dot modra dot org> <CAJimCsGPLYFYfAvF3OzyhCmCBvXp3FT3rF-7zb7H2jbi-3+BSQ at mail dot gmail dot com> <CALehDX7ec5i=-FCL1H=uuCwq2LXY53nt2a-MBZce3AZuEckqzQ at mail dot gmail dot com> <20150327114517 dot GA3655 at ratatosk> <CAG3jReJ_+vr08gKrNH7ucOcCFPHgW7_FvMph3O9d=+Kp954kww at mail dot gmail dot com>
On Fri, Mar 27, 2015 at 08:48:32AM -0400, Rafael Espíndola wrote:
> The use case in mind is saving size during -ffunction-section,
> -fdata-section, so we need real sections, not subsections.
You said you wanted multiple .text sections with the same group
signature, or at least that's what I understood. Why? If they are
part of the same group then surely a single .text is sufficient.
> Alan, why is section symbols a problem? We just produce multiple
> sections symbols.
They may not be any trouble at all, but some targets create a normal
symbol with the same name as the section (sorry, I wasn't being very
clear when I said section symbols). Presumably the symbol is used in
expressions relative to the start of the section, but I guess if your
assembly doesn't use that symbol you won't have a problem.
> Would an unique id help with the other issues (not
> familiar with ARM and IA64).
I'm also not that familiar, but I know that some ARM directives create
unwind information, stored in .ARM.exidx and .ARM.extab sections.
The section names are modified if the directives are in .text.foo or
.gnu.linkonce.t.foo and the sections are made part of the group if the
directive was in a group .text section. ie. the assembler knows about
linkonce and comdat group sections, and names emitted by gcc
-ffunction-sections. If you're using some other naming scheme then
you might need to tweak code in the ARM and IA64 assemblers.
Australia Development Lab, IBM