PR 11866
authorAlan Modra <amodra@gmail.com>
Mon, 2 Aug 2010 10:08:02 +0000 (10:08 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 2 Aug 2010 10:08:02 +0000 (10:08 +0000)
* elf.c (assign_file_positions_for_load_sections): Use p_vaddr to
calculate off_adjust rather than first section vma.

bfd/ChangeLog
bfd/elf.c

index 9b4223f8df935a33bb141ec15667d885dd35014d..e44b6428bf69c9e49e80408c44fc97015b1936c3 100644 (file)
@@ -1,3 +1,9 @@
+2010-08-02  Alan Modra  <amodra@gmail.com>
+
+       PR 11866
+       * elf.c (assign_file_positions_for_load_sections): Use p_vaddr to
+       calculate off_adjust rather than first section vma.
+
 2010-07-30  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elflink.c (compute_bucket_count): Add ATTRIBUTE_UNUSED to info.
index e7651ba3020fe0eb371c62f26ac1c64f35a40937..90fc3d1286c2cb3d576488f0bce6b79a3898de1d 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4337,7 +4337,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
                break;
              }
 
-         off_adjust = vma_page_aligned_bias (m->sections[0]->vma, off, align);
+         off_adjust = vma_page_aligned_bias (p->p_vaddr, off, align);
          off += off_adjust;
          if (no_contents)
            {