[RFC PATCH] avoid intermingling executable and nonexecutable sections in a segment

Alan Modra amodra@gmail.com
Wed Nov 21 01:17:00 GMT 2012


On Tue, Nov 20, 2012 at 04:57:54PM -0800, H.J. Lu wrote:
> On Tue, Nov 20, 2012 at 4:14 PM, Roland McGrath <mcgrathr@google.com> wrote:
> > Assuming HJ meant what I thought he meant, here is that version of the
> > change.  It does seem cleaner than a separate global.  It still doesn't
> > seem like a clean place to set the flag, but I don't know where else would
> > be better.
> >
> >
> > Thanks,
> > Roland
> >
> >
> > include/
> >         * bfdlink.h (struct bfd_link_info): New flag member `separate_code'.
> >
> > ld/
> >         * ldlang.c (ldlang_override_segment_assignment):
> >         If INFO->separate_code is set, then always return TRUE when
> >         SEC_CODE differs between the sections.
> >         * emultempl/elf32.em
> >         (gld${EMULATION_NAME}_after_open) [$SEPARATE_CODE = yes]:
> >         Set link_info.separate_code.
> >
> 
> Another place is ld_config_type in ld.h.

Yes, that is the best place for a ld option that isn't used by bfd,
and elf32.em:gld${EMULATION_NAME}_before_parse is probably the best
place to set it.  OK with those changes.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list