This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to use .pushsection?
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Lee Duhem <lee dot duhem at gmail dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 11 Oct 2007 17:04:59 +0100 (BST)
- Subject: Re: How to use .pushsection?
- References: <da43c2e0710102030w5955dc98r52bb142da0c947a7@mail.gmail.com>
On Thu, 11 Oct 2007, Lee Duhem wrote:
> The document says
>
> `.pushsection NAME , SUBSECTION'
>
> This directive pushes the current section (and subsection) onto the
> top of the section stack, and then replaces the current section and
> subsection with `name' and `subsection'.
>
> but when assembling the following sentences:
>
> .section sec1
>
> .pushsection sec2,1
>
> gas complaining
>
> t.s: Assembler messages:
> t.s:3: Error: character following name is not '#'
>
> What's this error mean? Did I misunderstood some thing?
The syntax is unimplemented -- you can only select a section, optionally
followed by a flags, like with the .section directive. The reason code
disagrees with documentation is probably them having been added at
different times, about a year apart. A possible workaround is as follows:
.section sec1
.pushsection sec2
.pushsection sec2
.subsection 1
.previous
.popsection
Ugly, but it should work. I think it would be a good idea to make
.pushsection match the documentation with respect to subsections though as
this is useful semantics.
Maciej