* write.c (relax_segment): Don't zap fr_symbol when relaxing.
authorAlan Modra <amodra@gmail.com>
Thu, 24 May 2001 23:33:00 +0000 (23:33 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 24 May 2001 23:33:00 +0000 (23:33 +0000)
gas/ChangeLog
gas/write.c

index 6ae3422c0670cf66e077eb45a47bcb1571d56646..ed64d285430248502bb8086b455ec0cd37289e5f 100644 (file)
@@ -1,3 +1,7 @@
+2001-05-25  Alan Modra  <amodra@one.net.au>
+
+       * write.c (relax_segment): Don't zap fr_symbol when relaxing.
+
 2000-05-24  Tom Rix <trix@redhat.com>
 
        * config/obj-coff.c : (add_lineno) xcoff allows negative line
index 7b9e08039e7edc0d7a19ee8528229b444ca1b479..1880e7eccbf8f44db69fa18dd0df014916df4676 100644 (file)
@@ -2453,18 +2453,22 @@ relax_segment (segment_frag_root, segment)
              case rs_space:
                if (symbolP)
                  {
-                   growth = S_GET_VALUE (symbolP);
+                   offsetT amount;
+
+                   amount = S_GET_VALUE (symbolP);
                    if (symbol_get_frag (symbolP) != &zero_address_frag
                        || S_IS_COMMON (symbolP)
                        || ! S_IS_DEFINED (symbolP))
                      as_bad_where (fragP->fr_file, fragP->fr_line,
                                    _(".space specifies non-absolute value"));
-                   fragP->fr_symbol = 0;
-                   if (growth < 0)
+                   if (amount < 0)
                      {
                        as_warn (_(".space or .fill with negative value, ignored"));
-                       growth = 0;
+                       amount = 0;
+                       fragP->fr_symbol = 0;
                      }
+                   growth = (fragP->fr_address + amount
+                             - fragP->fr_next->fr_address);
                  }
                else
                  growth = 0;