Removing empty sections from elf_bfd_discard_info

Jakub Jelinek jakub@redhat.com
Tue Dec 18 04:32:00 GMT 2001


On Tue, Dec 18, 2001 at 10:53:39PM +1030, Alan Modra wrote:
> On Tue, Dec 18, 2001 at 01:16:04PM +0100, Jakub Jelinek wrote:
> > Hi!
> > 
> > I found one more problem with the --eh-frame-hdr patch, which is common
> > to the stabs optimization code as well (where I copied it from).
> >   if (sec->_cooked_size == 0)
> >     sec->flags |= SEC_EXCLUDE;
> > really doesn't work at all, section sizing code in ld doesn't care about
> > this. Neither works setting sec->output_section to bfd_abs_section_ptr.
> > 
> > What do you think is best to tackle this?
> 
> I wonder if it's possible to simply use a single field for the section
> size?  Why do we really need both _raw_size and _cooked_size?  Hmm, if
> relaxation needs the original size, how about renaming the two fields to
> "size" and "orig_size" and using "size" practically everywhere?

The relaxation and section optimization code needs both sizes.
If all setters of _raw_size would be changed to set both size and orig_size,
then it might work, though there will be code chunks which will need
careful inspection.

	Jakub



More information about the Binutils mailing list