[PATCH] Fix -Ttext -z combreloc (was Re: Not enough room for program headers (problem with 2.11.92.0.5))

Jakub Jelinek jakub@redhat.com
Wed Oct 17 11:12:00 GMT 2001


Hi!

On Wed, Oct 17, 2001 at 09:16:36AM -0700, H . J . Lu wrote:
> On Wed, Oct 17, 2001 at 06:11:08PM +0200, Jakub Jelinek wrote:
> > > Don't use -z combreloc in this case. That is one reason why I didn't
> > > turn on -z combreloc by default in my binutils. It should only be done
> > > when it makes senses and is safe. It looks like no one should turn on
> > > -z combreloc by default unless everything is worked out.
> > 
> > Can I get a copy of misc.o (or misc.i)?
> > -z combreloc really should be the default, the speed advantages are huge, so
> > if there is some issue with it, I'd like to debug it.
> > 
> 
> See misc.i in
> 
> http://sources.redhat.com/ml/bug-gnu-utils/2001-10/msg00194.html

What happens is that _bfd_strip_section_from_output was not ever stripping
output .rel.dyn section, because 2 different sections in dynobj had it as
their output_section (.rel.text and .rel.data). As
_bfd_strip_section_from_output doesn't change the input sections in any way,
when calling it on .rel.text it wasn't stripped because .rel.data pointed to
it too (that's correct), but when calling it on .rel.data, it wasn't
stripped because .rel.text pointed to it too (but .rel.text shouldn't count
as reference since _bfd_strip_section_from_output was called on it already).
Here are 2 alternative patches, the first one uses SEC_EXCLUDE flag to mark
input section's whose output was stripped, the second one makes a copy of
the output section. Setting s->output_section to bfd_abs_section_ptr doesn't
work, it is too late.
Ok to commit the first one (provided you think I can abuse SEC_EXCLUDE flag
for this - make check passed)?

	Jakub


More information about the Binutils mailing list