summaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-07-14 14:02:33 +0000
committerIan Lance Taylor <ian@airs.com>1999-07-14 14:02:33 +0000
commitd9ce3d13350283c2b03ef4c91ca09c0225c37c3e (patch)
tree028fb0f31497065ab0ff45cb23dfe1c8f704148a /gas/write.c
parenta3c9e5c72f3f9c2473ac454e1e4c36a7934a0411 (diff)
downloadbinutils-redhat-d9ce3d13350283c2b03ef4c91ca09c0225c37c3e.tar.gz
* 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.
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gas/write.c b/gas/write.c
index ed74709730..0c28ac7fd9 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -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 */