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: Nick Clifton <nickc at redhat dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 22 Feb 2007 10:53:51 +0000
- Subject: Re: PATCH: PR gas/4029: relax_segment can't stabilize .gcc_except_table
- References: <20070219025438.GA10913@lucon.org> <20070219071927.GA11730@lucon.org>
Hi H. J.
2007-02-19 H.J. Lu <hongjiu.lu@intel.com>
PR gas/4029
* frags.h (frag): Add growth_count and last_growth.
* write.c (relax_segment): Break infinite loop for rs_leb128.
Could you make a couple of small changes please ?
+ unsigned int growth_count: 4;
+ unsigned int last_growth: 2;
I think that it would be clearer if you used #define'd values for the
numbers stored in the last_growth field, rather than just using
constants. eg:
#define LAST_GROWTH_UNKNOWN 0
#define LAST_GROWTH_INCREASE 1
#define LAST_GROWTH_SHRINK 2
+ 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;
+ }
I also think that we ought to have a testcase to check this code, and we
ought to refer to that testcase in the above comment so that future
readers of the code can reproduce the problem for themselves. (If
possible the testcase ought to have some way of timing out rather than
going into an infinite loop if the code is broken, although I am not
sure how you can do this using dejagnu. Are the gas tests time limited
in the same way as the gcc tests ?)
Cheers
Nick