+2001-05-26 Alan Modra <amodra@one.net.au>
+
+ * write.c (relax_segment <rs_space>): Calculate growth using
+ addresses before stretch. Prevent repeated error messages.
+ From Peter Jakubek <pjak@snafu.de>
+ Use as_bad_where and as_warn_where to pinpoint errors.
+
2001-05-25 Alan Modra <amodra@one.net.au>
* symbols.c (resolve_symbol_value): Always set segment, even when
* symbols.c (resolve_symbol_value): Clear sy_resolving before
taking exit_dont_set_value.
- * write.c (relax_segment): Don't zap fr_symbol when relaxing.
+ * write.c (relax_segment <rs_space>): Don't zap fr_symbol when
+ relaxing.
2000-05-24 Tom Rix <trix@redhat.com>
if (offset % fragP->fr_var != 0)
{
- as_bad (_("alignment padding (%lu bytes) not a multiple of %ld"),
- (unsigned long) offset, (long) fragP->fr_var);
+ as_bad_where (fragP->fr_file, fragP->fr_line,
+ _("alignment padding (%lu bytes) not a multiple of %ld"),
+ (unsigned long) offset, (long) fragP->fr_var);
offset -= (offset % fragP->fr_var);
}
{
char buf[50];
sprint_value (buf, (addressT) lie->addnum);
- as_warn (_(".word %s-%s+%s didn't fit"),
- S_GET_NAME (lie->add),
- S_GET_NAME (lie->sub),
- buf);
+ as_warn_where (fragP->fr_file, fragP->fr_line,
+ _(".word %s-%s+%s didn't fit"),
+ S_GET_NAME (lie->add),
+ S_GET_NAME (lie->sub),
+ buf);
}
lie->added = 1;
if (fragP->fr_subtype == 0)
}
case rs_space:
+ growth = 0;
if (symbolP)
{
offsetT amount;
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"));
- if (amount < 0)
{
- as_warn (_(".space or .fill with negative value, ignored"));
- amount = 0;
+ as_bad_where (fragP->fr_file, fragP->fr_line,
+ _(".space specifies non-absolute value"));
+ /* Prevent repeat of this error message. */
+ fragP->fr_symbol = 0;
+ }
+ else if (amount < 0)
+ {
+ as_warn_where (fragP->fr_file, fragP->fr_line,
+ _(".space or .fill with negative value, ignored"));
fragP->fr_symbol = 0;
}
- growth = (fragP->fr_address + amount
- - fragP->fr_next->fr_address);
+ else
+ growth = (was_address + amount
+ - fragP->fr_next->fr_address);
}
- else
- growth = 0;
break;
case rs_machine_dependent: