diff options
author | Alan Modra <amodra@gmail.com> | 2010-10-19 12:14:23 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2010-10-19 12:14:23 +0000 |
commit | 20f5cfbdeace664dca0f967e4f20fa45e37947d5 (patch) | |
tree | 635e0d6bfad34f66de467886cddc33d731c28c10 | |
parent | e35a414d3cd7c422e39db2611a063664cee3be70 (diff) | |
download | gdb-20f5cfbdeace664dca0f967e4f20fa45e37947d5.zip gdb-20f5cfbdeace664dca0f967e4f20fa45e37947d5.tar.gz gdb-20f5cfbdeace664dca0f967e4f20fa45e37947d5.tar.bz2 |
* write.c (relax_segment): Correct address on frag added to stop
leb128/align frags bouncing.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/write.c | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 905ba0d..0bd94f1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2010-10-19 Alan Modra <amodra@gmail.com> + * write.c (relax_segment): Correct address on frag added to stop + leb128/align frags bouncing. + +2010-10-19 Alan Modra <amodra@gmail.com> + PR gas/12049 * frags.h (struct frag): Add "region" field. * write.c (relax_frag): Don't add "stretch" to forward reference diff --git a/gas/write.c b/gas/write.c index 62f196c..080216a 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 |