This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Some extensions to the .section directive for ELF and COFF

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


subsection.s:6: Error: character following name is not '#'

So how to use subsections with other than standard sections is still a

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]