From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: hjl@lucon.org Cc: binutils@sourceware.cygnus.com Subject: Re: a bug in as Date: Wed, 14 Jul 1999 17:04:00 -0000 Message-id: <19990714210156.15589.qmail@daffy.airs.com> References: <19990713182834.B101657BA@ocean.lucon.org> X-SW-Source: 1999-q3/msg00205.html Date: Tue, 13 Jul 1999 11:28:34 -0700 (PDT) From: hjl@lucon.org (H.J. Lu) I got this report. The code is wrong. But as message doesn't help either. Is there a way for as to report correct line number? Also it shouldn't be an internal error. I checked in the appended patch. Ian Index: write.c =================================================================== RCS file: /cvs/binutils/binutils/gas/write.c,v retrieving revision 1.7 diff -u -r1.7 write.c --- write.c 1999/07/11 20:20:01 1.7 +++ write.c 1999/07/14 20:55:33 @@ -498,8 +498,9 @@ - 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 @@ /* 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 */