This is the mail archive of the binutils@sourceware.org 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: PATCH: PR ld/5522: Section contents partially overwritten with zero


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


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