aboutsummaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-05-24 23:33:00 +0000
committerAlan Modra <amodra@gmail.com>2001-05-24 23:33:00 +0000
commit766c03c9fa786d42e9252b3003a6ee0874ea10ec (patch)
treea4a68842428dd4d3a62b2f3908ecebf462b81dd8 /gas/write.c
parent1608870fd88f3202df6a42ba74cf6c9b78e98c6c (diff)
downloadgdb-766c03c9fa786d42e9252b3003a6ee0874ea10ec.zip
gdb-766c03c9fa786d42e9252b3003a6ee0874ea10ec.tar.gz
gdb-766c03c9fa786d42e9252b3003a6ee0874ea10ec.tar.bz2
* write.c (relax_segment): Don't zap fr_symbol when relaxing.
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gas/write.c b/gas/write.c
index 7b9e080..1880e7e 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -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;