This is the mail archive of the gas2@sourceware.cygnus.com mailing list for the gas2 project.


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

Re: Add -N support to ELF?


> 
>    From: hjl@nynexst.com (H.J. Lu)
>    Date: Mon, 20 Feb 95 13:30:57 EST
> 
>    1. When -N is not used, if the sh_flags of the current section
>       is not compatible with the p_flags of the current segment, start
>       a new segment.
> 
>    2. When -N is used, behave just like the old way.
> 
> This seems reasonable in principle.  The trick is defining
> ``compatible'' is a useful fashion.  I have not been able to think of
> a good definition, but I haven't thought about it all that much,
> either.

By "compatible", I mean 

((hdr->sh_flags & SHF_WRITE) && (phdr->p_flags & PF_W))

or

((hdr->sh_flags & SHF_WRITE) == 0 && (phdr->p_flags & PF_W) == 0)

As a matter of fact, the code is already there in elfcode.h in
my source tree. But it is commented out with

/* FIXME: ctors/dtors contain the code, but are r/w. */

We have moved ctors/dtors into the data section. That won't
be the problem any more. But this may break those embedded systems.


H.J.