* write.c (cvt_frag_to_fill): Use frag file and line in rs_org
authorIan Lance Taylor <ian@airs.com>
Wed, 14 Jul 1999 14:02:33 +0000 (14:02 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 14 Jul 1999 14:02:33 +0000 (14:02 +0000)
error message.
(relax_segment): Likewise.  After giving a rs_org error, convert
the frag to rs_align to avoid cascading errors.

gas/ChangeLog
gas/write.c

index 6f12ac9d8826550cf5141eb8a451eb4d4188d2b5..a30a084f98a143eb351539f99619f3069356a086 100644 (file)
@@ -1,3 +1,10 @@
+1999-07-14  Ian Lance Taylor  <ian@zembu.com>
+
+       * write.c (cvt_frag_to_fill): Use frag file and line in rs_org
+       error message.
+       (relax_segment): Likewise.  After giving a rs_org error, convert
+       the frag to rs_align to avoid cascading errors.
+
 1999-07-12  Andreas Schwab  <schwab@suse.de>
 
        * config/tc-m68k.c: Add some ATTRIBUTE_UNUSED.
index ed74709730795475e617804bb6e27c54ab14e383..0c28ac7fd916bb22b253e3f4bea7fa379f528615 100644 (file)
@@ -498,8 +498,9 @@ cvt_frag_to_fill (headersP, sec, fragP)
                          - fragP->fr_fix) / fragP->fr_var;
       if (fragP->fr_offset < 0)
        {
-         as_bad (_("attempt to .org/.space backwards? (%ld)"),
-                 (long) fragP->fr_offset);
+         as_bad_where (fragP->fr_file, fragP->fr_line,
+                       _("attempt to .org/.space backwards? (%ld)"),
+                       (long) fragP->fr_offset);
        }
       fragP->fr_type = rs_fill;
       break;
@@ -2302,8 +2303,16 @@ relax_segment (segment_frag_root, segment)
                      /* Growth may be negative, but variable part of frag
                         cannot have fewer than 0 chars.  That is, we can't
                         .org backwards. */
-                     as_bad (_("attempt to .org backwards ignored"));
-                     growth = 0;
+                     as_bad_where (fragP->fr_file, fragP->fr_line,
+                                   _("attempt to .org backwards ignored"));
+
+                     /* We've issued an error message.  Change the
+                         frag to avoid cascading errors.  */
+                     fragP->fr_type = rs_align;
+                     fragP->fr_subtype = 0;
+                     fragP->fr_offset = 0;
+                     fragP->fr_fix = after - address;
+                     growth = stretch;
                    }
 
                  growth -= stretch;    /* This is an absolute growth factor */