This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]