This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
patch for gas/config/tc-i960.c (md_estimate_size_before_relax)
- From: Jim Wilson <wilson at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 8 May 2002 21:45:13 -0400
- Subject: patch for gas/config/tc-i960.c (md_estimate_size_before_relax)
A build of the i960-elf toolchain from the uberbaum tree gets a gas abort
in cvt_frag_to_fill while compiling newlib/libc/stdio/vfprintf.c. We hit
the abort because fr_address + fr_fix != fr_next->fr_address for a
rs_machine_dependent frag.
I blindly compared the i960 relaxation code against other ports, and came
up with the following fix.
This was apparently broken when Alan Modra checked in his multi-pass
relaxation support last year, i.e.
http://sources.redhat.com/ml/binutils/2001-03/msg00410.html
Previously, relaxation was done only once, and frag_variant was always called
with a subtype of 1 with a length of 0, so it was safe for md_estimate_size_
before_relax to always return 0. Now, relaxation can be done multiple times,
and we might be given a frag that has already been relaxed, so we need to
check the subtype and return the current size.
This seems clearly correct, and I have write priviledges, so I went ahead
and checked it in.
gas/ChangeLog
2002-05-08 Jim Wilson <wilson@redhat.com>
* config/tc-i960.c (md_estimate_size_before_relax): Return size of
current variable part of frag.
Index: tc-i960.c
===================================================================
RCS file: /cvs/uberbaum/gas/config/tc-i960.c,v
retrieving revision 1.11
diff -p -r1.11 tc-i960.c
*** tc-i960.c 15 Nov 2001 21:28:56 -0000 1.11
--- tc-i960.c 9 May 2002 00:59:12 -0000
*************** md_estimate_size_before_relax (fragP, se
*** 1085,1091 ****
relax_cobr (fragP);
return 4;
}
! return 0;
} /* md_estimate_size_before_relax() */
#if defined(OBJ_AOUT) | defined(OBJ_BOUT)
--- 1085,1092 ----
relax_cobr (fragP);
return 4;
}
!
! return md_relax_table[fragP->fr_subtype].rlx_length;
} /* md_estimate_size_before_relax() */
#if defined(OBJ_AOUT) | defined(OBJ_BOUT)