This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch committed] Fix tc-sh.c:align_test_frag_offset_fixed_p
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: binutils at sources dot redhat dot com
- Date: Mon, 16 Apr 2007 07:04:17 +0900 (JST)
- Subject: [patch committed] Fix tc-sh.c:align_test_frag_offset_fixed_p
I've committed the attached patch as a follow-up patch according
to Alan's suggestion
http://sourceware.org/ml/binutils/2007-04/msg00195.html.
Regtested on sh-elf, sh4-unknown-linux-gnu with no new failures.
Regards,
kaz
--
2007-04-15 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* config/tc-sh.c (align_test_frag_offset_fixed_p): Handle
rs_fill frags.
diff -uprN ORIG/src/gas/config/tc-sh.c LOCAL/src/gas/config/tc-sh.c
--- ORIG/src/gas/config/tc-sh.c 2007-04-15 15:41:20.000000000 +0900
+++ LOCAL/src/gas/config/tc-sh.c 2007-04-15 15:46:19.000000000 +0900
@@ -847,9 +847,13 @@ align_test_frag_offset_fixed_p (const fr
/* Maybe frag2 is after frag1. */
frag = frag1;
- while (frag->fr_type == rs_align_test)
+ while (frag->fr_type == rs_fill
+ || frag->fr_type == rs_align_test)
{
- off += frag->fr_fix;
+ if (frag->fr_type == rs_fill)
+ off += frag->fr_fix + frag->fr_offset * frag->fr_var;
+ else
+ off += frag->fr_fix;
frag = frag->fr_next;
if (frag == NULL)
break;
@@ -863,9 +867,13 @@ align_test_frag_offset_fixed_p (const fr
/* Maybe frag1 is after frag2. */
off = frag1->fr_address - frag2->fr_address;
frag = frag2;
- while (frag->fr_type == rs_align_test)
+ while (frag->fr_type == rs_fill
+ || frag->fr_type == rs_align_test)
{
- off -= frag->fr_fix;
+ if (frag->fr_type == rs_fill)
+ off -= frag->fr_fix + frag->fr_offset * frag->fr_var;
+ else
+ off -= frag->fr_fix;
frag = frag->fr_next;
if (frag == NULL)
break;