PATCH: PR gas/4029: relax_segment can't stabilize .gcc_except_table
Alan Modra
amodra@bigpond.net.au
Sat Mar 10 11:09:00 GMT 2007
On Fri, Feb 23, 2007 at 11:18:49PM -0800, H. J. Lu wrote:
> On Fri, Feb 23, 2007 at 12:05:54AM +1030, Alan Modra wrote:
> > On Sun, Feb 18, 2007 at 11:19:27PM -0800, H. J. Lu wrote:
> > > + if (growth == -1
> > > + && fragP->growth_count == 0xf)
> > > + {
> > > + /* There are 15 growths after shrinks. To break
> > > + the infinite loop, we grow the size by 1 instead
> > > + of shrinking it by 1. */
> > > + growth = 1;
> > > + }
> >
> > HJ, how can this possibly work? If you arbitrarily change the growth,
> > then all following frags will have their address set incorrectly.
> > At least, that's what is seems like to me. Hmm, I suppose you might
> > have found something that works for one specific case of following
> > frag types, but I don't think this can be correct in general.
>
> It works because the size of rs_leb128 depends on its value. When
> its value changes due to relaxation, its size may increase or decrease.
> You can change its size which will change addresses of all following
> frags. In turn, it will change the value of rs_leb128. I added
> an assert to cvt_frag_to_fill to make sure that rs_leb128 size matches
> its value.
Nope, you have just generated incorrect output. See the analysis I
added to the bug.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list