A very "strange" bug in gcc 2.96

H . J . Lu hjl@lucon.org
Sun May 21 23:53:00 GMT 2000


On Mon, May 22, 2000 at 03:02:37PM +1000, Alan Modra wrote:
> On Sun, 21 May 2000, H . J . Lu wrote:
> 
> > > > > For x86, gas/config/tc-i386.c:md_estimate_size_before_relax needs to be
> > > > > taught how to handle this case properly.  (I think that's all that's
> > > > > needed...)
> > 
> > Assume it is correct, do you have a patch I can try?
> 
> No, not yet, and I'm busy on other things.  I was hoping you would have a
> go at fixing it ;-)
> 

How about this patch?


H.J.
---
2000-05-21  H.J. Lu  (hjl@gnu.org)

	* config/tc-i386.c (md_estimate_size_before_relax): Don't
	relax external symbols.

Index: config/tc-i386.c
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/config/tc-i386.c,v
retrieving revision 1.23
diff -u -p -r1.23 tc-i386.c
--- config/tc-i386.c	2000/05/14 17:25:52	1.23
+++ config/tc-i386.c	2000/05/22 06:42:51
@@ -3766,7 +3766,8 @@ md_estimate_size_before_relax (fragP, se
   opcode = (unsigned char *) fragP->fr_opcode;
   /* We've already got fragP->fr_subtype right;  all we have to do is
      check for un-relaxable symbols.  */
-  if (S_GET_SEGMENT (fragP->fr_symbol) != segment)
+  if (!S_IS_LOCAL (fragP->fr_symbol)
+      || S_GET_SEGMENT (fragP->fr_symbol) != segment)
     {
       /* symbol is undefined in this segment */
       int code16 = fragP->fr_subtype & CODE16;


More information about the Binutils mailing list