This is the mail archive of the binutils@sources.redhat.com 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: looking for non-loaded, non-writable, non-allocated elf segment


Andrew Brown <atatat@atatdot.net> writes:

> >Your workaround depends upon the particular implementation used by
> >both gcc and gas.  It may continue to work in future releases, but you
> >should not expect it.  It may work for other targets, but you should
> >not expect that either.
> 
> okay.  i sort of expected the "might not continue" answer, and i do
> only expect it to work on elf (as indicated above), but...there is a
> certain interaction between the compiler and the assembler that i
> still feel uncertain on.

When I say ``may work for other targets,'' I mean other processors,
not just other object file formats.  I don't know if you mentioned,
but I would guess that you are testing using an ix86 system.  I
predict that your workaround will not work on a SPARC NetBSD system,
or indeed any SPARC system.  This is because the SPARC uses a
different comment character.

> the comment in the gas source to which i referred says this:
> 
> /* Handle the .section pseudo-op.  This code supports two different
>    syntaxes.
> 
>    The first is found on Solaris, and looks like
>        .section ".sec1",#alloc,#execinstr,#write
>    Here the names after '#' are the SHF_* flags to turn on for the
>    section.  I'm not sure how it determines the SHT_* type (BFD
>    doesn't really give us control over the type, anyhow).
> 
>    The second format is found on UnixWare, and probably most SVR4
>    machines, and looks like
>        .section .sec1,"a",@progbits
>    The quoted string may contain any combination of a, w, x, and
>    represents the SHF_* flags to turn on for the section.  The string
>    beginning with '@' can be progbits or nobits.  There should be
>    other possibilities, but I don't know what they are.  In any case,
>    BFD doesn't really let us set the section type.  */
> 
> but gas doesn't seem to like the first form under netbsd.  is this
> because the first form is *only* available under solaris?

The first form is not available on any processor for which '#' is a
comment character.  Thus, it is not available on the ix86.

Ian


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