* write.c (relax_segment <rs_org>): Include current stretch
authorAlan Modra <amodra@gmail.com>
Tue, 24 Jun 2008 01:49:36 +0000 (01:49 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 24 Jun 2008 01:49:36 +0000 (01:49 +0000)
value when calculating whether .org is backwards.

gas/ChangeLog
gas/write.c

index b4e0e98a9d6054321f46184c6d3c67ad046ad825..ef7819db9ee979a82618e87f52a129efb99e5300 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-24  Bob Wilson  <bob.wilson@acm.org>
+           Alan Modra  <amodra@bigpond.net.au>
+
+       * write.c (relax_segment <rs_org>): Include current stretch
+       value when calculating whether .org is backwards.
+
 2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * configure: Regenerate.
index 9875f7f68728b3b2a42cc73152cb2c59861abf85..2ba44b9173d5e833d18570cdb915db4a1b8f70e5 100644 (file)
@@ -2305,7 +2305,7 @@ relax_segment (struct frag *segment_frag_root, segT segment, int pass)
                    }
 
                  know (fragP->fr_next);
-                 after = fragP->fr_next->fr_address;
+                 after = fragP->fr_next->fr_address + stretch;
                  growth = target - after;
                  if (growth < 0)
                    {
@@ -2340,14 +2340,10 @@ relax_segment (struct frag *segment_frag_root, segT segment, int pass)
                      fragP->fr_type = rs_align;
                      fragP->fr_subtype = 0;
                      fragP->fr_offset = 0;
-                     fragP->fr_fix = after - was_address;
-                     break;
+                     fragP->fr_fix = after - address;
                    }
-
-                 /* This is an absolute growth factor  */
-                 growth -= stretch;
-                 break;
                }
+               break;
 
              case rs_space:
                growth = 0;