This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR gas/4029: relax_segment can't stabilize .gcc_except_table
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 10 Mar 2007 21:39:41 +1030
- Subject: Re: PATCH: PR gas/4029: relax_segment can't stabilize .gcc_except_table
- References: <20070219025438.GA10913@lucon.org> <20070219071927.GA11730@lucon.org> <20070222133554.GB29005@bubble.grove.modra.org> <20070224071849.GA31084@lucon.org>
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