PR ld/14926
authorAlan Modra <amodra@gmail.com>
Fri, 7 Dec 2012 04:58:36 +0000 (04:58 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 7 Dec 2012 04:58:36 +0000 (04:58 +0000)
* elf.c (_bfd_elf_map_sections_to_segments): Include elf header
size when determining phdr_in_segment.

bfd/ChangeLog
bfd/elf.c

index 1b6e9654cc2da8f3129ffd9a381b4713b185abae..b8fb291935ea8b7cd44de1767be816b9149a110b 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-07  Alan Modra  <amodra@gmail.com>
+
+       PR ld/14926
+       * elf.c (_bfd_elf_map_sections_to_segments): Include elf header
+       size when determining phdr_in_segment.
+
 2012-12-06  Yufeng Zhang  <yufeng.zhang@arm.com>
 
        * elf64-aarch64.c (elf64_aarch64_grok_prstatus): New function.
index a93663619a1d538450b5044f5aa38cbca8f018a4..f010f5ae509385a4e8bcf4f821e46dc6f9f31f72 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3874,6 +3874,7 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
 
          if (phdr_size == (bfd_size_type) -1)
            phdr_size = get_program_header_size (abfd, info);
+         phdr_size += bed->s->sizeof_ehdr;
          if ((abfd->flags & D_PAGED) == 0
              || (sections[0]->lma & addr_mask) < phdr_size
              || ((sections[0]->lma & addr_mask) % maxpagesize