This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/5522: Section contents partially overwritten with zero
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: "H.J. Lu" <hjl at lucon dot org>, binutils at sources dot redhat dot com
- Date: Tue, 8 Jan 2008 21:29:56 +1030
- Subject: Re: PATCH: PR ld/5522: Section contents partially overwritten with zero
- References: <20071227012529.GA28727@lucon.org> <20071227175254.GA419@lucon.org> <4782560E.1000509@redhat.com>
> >2007-12-27 H.J. Lu <hongjiu.lu@intel.com>
> >
> > PR ld/5522
> > * elflink.c (elf_link_input_bfd): Don't write out a section if
> > its output section is marked with SEC_NEVER_LOAD.
ld.info gives an example of NOLOAD output sections saying "The
contents of the section will appear in the linker output file as
usual". NOLOAD sets SEC_NEVER_LOAD on the output section, therefore
not writing out the section here is wrong. I think we are suffering
bit rot. Probably partly my fault..
>From what I can see of the history (I can't access private Cygnus CVS,
so can't see before 1999), it appears that SEC_NEVER_LOAD was
invented for COFF to mirror STYP_NOLOAD. I'm inclined to think it
should remain that way. ie. Only used in COFF code or in the generic
linker code to hanlde NOLOAD. ELF doesn't have an external section
flag similar to STYP_NOLOAD so SEC_NEVER_LOAD should not appear
anywhere in ELF specific code. SEC_LOAD is sufficient. Does anyone
have any enlightening comments?
--
Alan Modra
Australia Development Lab, IBM