summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/bfd/binary.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-09-04 19:11:21 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-09-04 19:11:21 +0000
commitc3c8d76890b592bf5acc1a9b7faeabd9b829dd71 (patch)
tree6358a23d0df9de73b6d5d6d3a75545ff35f05b47 /gnu/usr.bin/binutils/bfd/binary.c
parent4ba440a6e788da3a64fa29b782c37150a3f5cc18 (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.c13
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;
}