diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2002-06-29 21:45:09 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2002-06-29 21:45:09 +0000 |
commit | 8d28f606dc331fbe194fc6af8140efeadc020505 (patch) | |
tree | a24a86475b146ce629053dc2912fc26faec29865 | |
parent | 9f6067066d03beb6a208bbbf2741bbf0b8a1bce8 (diff) | |
download | gdb-8d28f606dc331fbe194fc6af8140efeadc020505.zip gdb-8d28f606dc331fbe194fc6af8140efeadc020505.tar.gz gdb-8d28f606dc331fbe194fc6af8140efeadc020505.tar.bz2 |
* mmo.c (mmo_write_loc_chunk): Don't eliminate leading and
trailing zero-sequences when there's previous left-over data.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/mmo.c | 23 |
2 files changed, 20 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c4a6878..a72dffb 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-06-29 Hans-Peter Nilsson <hp@bitrange.com> + + * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and + trailing zero-sequences when there's previous left-over data. + 2002-06-27 John David Anglin <dave@hiauly1.hia.nrc.ca> * elf64-hppa.c (elf64_hppa_reloc_type_class): New function. @@ -913,16 +913,23 @@ mmo_write_loc_chunk (abfd, vma, loc, len, last_vmap) /* Find an initial and trailing section of zero tetras; we don't need to write out zeros. FIXME: When we do this, we should emit section size and address specifiers, else objcopy can't always perform an identity - translation. */ - while (len >= 4 && bfd_get_32 (abfd, loc) == 0) + translation. Only do this if we *don't* have left-over data from a + previous write or the vma of this chunk is *not* the next address, + because then data isn't tetrabyte-aligned and we're concatenating to + that left-over data. */ + + if (abfd->tdata.mmo_data->byte_no == 0 || vma != *last_vmap) { - vma += 4; - len -= 4; - loc += 4; - } + while (len >= 4 && bfd_get_32 (abfd, loc) == 0) + { + vma += 4; + len -= 4; + loc += 4; + } - while (len >= 4 && bfd_get_32 (abfd, loc + len - 4) == 0) - len -= 4; + while (len >= 4 && bfd_get_32 (abfd, loc + len - 4) == 0) + len -= 4; + } /* Only write out the location if it's different than the one the caller (supposedly) previously handled, accounting for omitted leading zeros. */ |