Add -N support to ELF?

H.J. Lu
Mon Feb 20 12:50:00 GMT 1995

>    From: (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))


((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.


More information about the Gas2 mailing list