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: Erik Christiansen <dvalin at internode dot on dot net>
- To: binutils at sourceware dot org
- Date: Sat, 28 Mar 2015 18:37:07 +1100
- Subject: Re: Some extensions to the .section directive for ELF and COFF
- Authentication-results: sourceware.org; auth=none
- Reply-to: dvalin at internode dot on dot net
Apologies - somehow this didn't make it to the list late last night.
On 27.03.15 23:09, Alan Modra wrote:
> On Fri, Mar 27, 2015 at 10:45:17PM +1100, Erik Christiansen wrote:
> [re .subsection]
> > but no longer functional in "GNU assembler (GNU Binutils for Debian)
> > 2.22" or avr-as 2.20.1.20100303, if I'm holding my mouth right.
>
> What is broken? As far as I know, subsections still work. There's
> even a test in the testsuite, gas/testsuite/gas/elf/section6.s
Then I'm not holding my mouth right. Ah, the first syntax is accepted,
the second not:
.text 0
.ascii "That's the default, anyway."
.section .text 1
.ascii "This one's not."
subsection.s:6: Error: junk at end of line, first unrecognized character
is `1'
And adding a comma:
.section .text, 1
.ascii "This one's not."
gives:
subsection.s:6: Error: character following name is not '#'
So how to use subsections with other than standard sections is still a
puzzle.
On 27.03.15 08:48, Rafael EspÃndola wrote:
> The use case in mind is saving size during -ffunction-section,
> -fdata-section, so we need real sections, not subsections.
Ah, real sections within gcc, but subsections by the time it reaches
ELF. I should have caught the implication of the compiler options.
> For hand written assembly, they are relatively short and I don't
> expect programmers have problems creating short unique names for
> sections.
Already conceded, and a good embedded systems programmer can readily
tweak a linker script to arrange any number of input sections.
Thank you for the explanation.
Erik