This is the mail archive of the binutils@sourceware.org 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: How to use .pushsection?


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


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