From d2bcb0d1aaa0d73b3c7625d6d7a58e013969c28b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 7 Dec 2012 04:58:36 +0000 Subject: [PATCH] PR ld/14926 * elf.c (_bfd_elf_map_sections_to_segments): Include elf header size when determining phdr_in_segment. --- bfd/ChangeLog | 6 ++++++ bfd/elf.c | 1 + 2 files changed, 7 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1b6e9654cc2..b8fb291935e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2012-12-07 Alan Modra + + 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 * elf64-aarch64.c (elf64_aarch64_grok_prstatus): New function. diff --git a/bfd/elf.c b/bfd/elf.c index a93663619a1..f010f5ae509 100644 --- 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 -- 2.30.2