diff options
author | Alan Modra <amodra@bigpond.net.au> | 2010-10-19 12:14:22 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2010-10-19 12:14:22 +0000 |
commit | e67cfb18c4941114acd65c66f54a31663b981638 (patch) | |
tree | ffd2181cddc8a8e91f35eb47959e2fb04f4b9bfd /gas/write.c | |
parent | 56c90995c6b241984ecf7a0474e0e33c5cc24c04 (diff) | |
download | binutils-redhat-e67cfb18c4941114acd65c66f54a31663b981638.tar.gz |
* write.c (relax_segment): Correct address on frag added to stop
leb128/align frags bouncing.
Diffstat (limited to 'gas/write.c')
-rw-r--r-- | gas/write.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gas/write.c b/gas/write.c index 62f196c0de..080216a240 100644 --- a/gas/write.c +++ b/gas/write.c @@ -2525,6 +2525,7 @@ relax_segment (struct frag *segment_frag_root, segT segment, int pass) fragP->fr_literal + fragP->fr_fix, fragP->fr_var); newf->fr_type = rs_fill; + newf->fr_address = address + fragP->fr_fix + newoff; newf->fr_fix = 0; newf->fr_offset = (((offsetT) 1 << fragP->fr_offset) / fragP->fr_var); @@ -2534,13 +2535,11 @@ relax_segment (struct frag *segment_frag_root, segT segment, int pass) newf->fr_offset = (offsetT) 1 << fragP->fr_offset; newf->fr_var = 1; } - /* Include growth of new frag, because rs_fill - frags don't normally grow. */ + /* Include size of new frag in GROWTH. */ growth += newf->fr_offset * newf->fr_var; - /* The new frag address is newoff. Adjust this - for the amount we'll add when we process the - new frag. */ - newf->fr_address = newoff - stretch - growth; + /* Adjust the new frag address for the amount + we'll add when we process the new frag. */ + newf->fr_address -= stretch + growth; newf->relax_marker ^= 1; fragP->fr_next = newf; #ifdef DEBUG |