OSDN Git Service

bfd/
authorRichard Sandiford <rsandifo@nildram.co.uk>
Thu, 10 May 2007 14:46:48 +0000 (14:46 +0000)
committerRichard Sandiford <rsandifo@nildram.co.uk>
Thu, 10 May 2007 14:46:48 +0000 (14:46 +0000)
* elf.c (assign_file_positions_for_load_sections): Use p_memsz
rather than p_filesz to calculate the LMA of the end of a segment.

ld/testsuite/
* ld-elf/multibss1.d, ld-elf/multibss1.s: New test.

bfd/ChangeLog
bfd/elf.c

index f24593a..667a962 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-10  Richard Sandiford  <richard@codesourcery.com>
+
+       * elf.c (assign_file_positions_for_load_sections): Use p_memsz
+       rather than p_filesz to calculate the LMA of the end of a segment.
+
 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
 
        * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't do copyreloc
index ec0c1b3..6e1ab96 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4520,7 +4520,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
          if (p->p_type == PT_LOAD
              || p->p_type == PT_TLS)
            {
-             bfd_signed_vma adjust = sec->lma - (p->p_paddr + p->p_filesz);
+             bfd_signed_vma adjust = sec->lma - (p->p_paddr + p->p_memsz);
 
              if ((flags & SEC_LOAD) != 0
                  || ((flags & SEC_ALLOC) != 0