diff options
author | Nick Clifton <nickc@redhat.com> | 2001-06-13 07:58:05 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2001-06-13 07:58:05 +0000 |
commit | dee0a8f47f702f416f473112badf780d38a374d6 (patch) | |
tree | 6b7381f86168cbcb262e4cd6ba736db29a7772a1 /bfd | |
parent | 261def7062894a4d6f6e31848c1426d119c0c9c2 (diff) | |
download | gdb-dee0a8f47f702f416f473112badf780d38a374d6.zip gdb-dee0a8f47f702f416f473112badf780d38a374d6.tar.gz gdb-dee0a8f47f702f416f473112badf780d38a374d6.tar.bz2 |
Only pad the tesxt section if the data section is going to follow it.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/aoutx.h | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index eea5f48..c2f6277 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2001-06-13 Nick Clifton <nickc@cambridge.redhat.com> + + * aoutx.h (adjust_z_magic): Only pad the tesxt section if the data + section is going to follow it. + 2001-06-12 Catherine Moore <clm@redhat.com> * elflink.h (elf_gc_propagate_vtable_entries): Replace FILE_ALIGN diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 93b939a..6119564 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1006,10 +1006,14 @@ adjust_z_magic (abfd, execp) } if (abdp && abdp->zmagic_mapped_contiguous) { - text_pad = (obj_datasec(abfd)->vma - - obj_textsec(abfd)->vma - - obj_textsec(abfd)->_raw_size); - obj_textsec(abfd)->_raw_size += text_pad; + asection * text = obj_textsec (abfd); + asection * data = obj_datasec (abfd); + + text_pad = data->vma - (text->vma + text->_raw_size); + /* Only pad the text section if the data + section is going to be placed after it. */ + if (text_pad > 0) + text->_raw_size += text_pad; } obj_datasec(abfd)->filepos = (obj_textsec(abfd)->filepos + obj_textsec(abfd)->_raw_size); |