diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-09-04 19:11:21 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-09-04 19:11:21 +0000 |
commit | c3c8d76890b592bf5acc1a9b7faeabd9b829dd71 (patch) | |
tree | 6358a23d0df9de73b6d5d6d3a75545ff35f05b47 /gnu/usr.bin/binutils/bfd/binary.c | |
parent | 4ba440a6e788da3a64fa29b782c37150a3f5cc18 (diff) |
Merge the Cygnus 960904 sources
Diffstat (limited to 'gnu/usr.bin/binutils/bfd/binary.c')
-rw-r--r-- | gnu/usr.bin/binutils/bfd/binary.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gnu/usr.bin/binutils/bfd/binary.c b/gnu/usr.bin/binutils/bfd/binary.c index a480e464e96..3972bc9a566 100644 --- a/gnu/usr.bin/binutils/bfd/binary.c +++ b/gnu/usr.bin/binutils/bfd/binary.c @@ -260,16 +260,17 @@ binary_set_section_contents (abfd, sec, data, offset, size) bfd_vma low; asection *s; - /* The lowest section VMA sets the virtual address of the start - of the file. We use the set the file position of all the + /* The lowest section LMA sets the virtual address of the start + of the file. We use this to set the file position of all the sections. */ - low = abfd->sections->vma; + low = abfd->sections->lma; for (s = abfd->sections->next; s != NULL; s = s->next) - if (s->vma < low) - low = s->vma; + if ((s->flags & SEC_HAS_CONTENTS) != 0 + && s->lma < low) + low = s->lma; for (s = abfd->sections; s != NULL; s = s->next) - s->filepos = s->vma - low; + s->filepos = s->lma - low; abfd->output_has_begun = true; } |