This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Some extensions to the .section directive for ELF and COFF
- From: Cary Coutant <ccoutant at google dot com>
- To: Eric Christopher <echristo at gmail dot com>
- Cc: Cary Coutant <ccoutant at gmail dot com>, Rafael EspÃndola <rafael dot espindola at gmail dot com>, Binutils <binutils at sourceware dot org>, Nick Clifton <nickc at redhat dot com>, Richard Sandiford <rsandifo at linux dot vnet dot ibm dot com>, Reid Kleckner <rnk at google dot com>
- Date: Thu, 26 Mar 2015 15:14:29 -0700
- 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>
>> I'd prefer to extend the .section directive so you can give each
>> section both an "internal" (or "assembler") name, and an "external"
>> (or "linker") name. You can give each section a unique internal name
>> and switch back and forth at will, but they'll all get written to the
>> output file with the external name.
>
> This would more than double the amount of memory for strings that the
> assembler needs for this sort of thing. The general case for this is
> for compiler generated code and it should be able to do that without
> switching. Another option is to maybe have a numeric identifier after?
>
> , unique NUM
>
> to switch back? I'm not sure what the point of switching back is going
> to be in the general case (other than "hey, this might be useful").
I never said that the internal names had to be long. But in the GCC
case, we can take all the ".text.<function_name>" section names, put
an external name of ".text" on them, and be much better off in terms
of .o file size, without an appreciable difference in .s file size. It
would be icing on the cake to replace all those internal section names
with small numbers, to decrease the .s file size.
-cary