aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-08-08 01:43:28 +0000
committerAlan Modra <amodra@gmail.com>2009-08-08 01:43:28 +0000
commite7e75368a39c3fb6848cfef55b8fccdd732fdf8a (patch)
tree33d6a18af8717aa1c9ccfe297ef1b860631daa1b /bfd
parent93da6da6f9ce76b98ee218cab3b8acebe1358924 (diff)
downloadgdb-e7e75368a39c3fb6848cfef55b8fccdd732fdf8a.zip
gdb-e7e75368a39c3fb6848cfef55b8fccdd732fdf8a.tar.gz
gdb-e7e75368a39c3fb6848cfef55b8fccdd732fdf8a.tar.bz2
PR 10494
* elf.c (_bfd_elf_make_section_from_shdr): When setting up section LMAs, use ELF_IS_SECTION_IN_SEGMENT to match sections with headers.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c19
2 files changed, 7 insertions, 18 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e7d0e94..51b337c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2009-08-08 Alan Modra <amodra@bigpond.net.au>
+
+ PR 10494
+ * elf.c (_bfd_elf_make_section_from_shdr): When setting up section
+ LMAs, use ELF_IS_SECTION_IN_SEGMENT to match sections with headers.
+
2009-08-07 Tom Tromey <tromey@redhat.com>
* elf32-microblaze.c (microblaze_elf_check_relocs): Avoid strict
diff --git a/bfd/elf.c b/bfd/elf.c
index 85829ec..408cebd 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -971,25 +971,8 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
phdr = elf_tdata (abfd)->phdr;
for (i = 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++)
{
- /* This section is part of this segment if its file
- offset plus size lies within the segment's memory
- span and, if the section is loaded, the extent of the
- loaded data lies within the extent of the segment.
-
- Note - we used to check the p_paddr field as well, and
- refuse to set the LMA if it was 0. This is wrong
- though, as a perfectly valid initialised segment can
- have a p_paddr of zero. Some architectures, eg ARM,
- place special significance on the address 0 and
- executables need to be able to have a segment which
- covers this address. */
if (phdr->p_type == PT_LOAD
- && (bfd_vma) hdr->sh_offset >= phdr->p_offset
- && (hdr->sh_offset + hdr->sh_size
- <= phdr->p_offset + phdr->p_memsz)
- && ((flags & SEC_LOAD) == 0
- || (hdr->sh_offset + hdr->sh_size
- <= phdr->p_offset + phdr->p_filesz)))
+ && ELF_IS_SECTION_IN_SEGMENT (hdr, phdr))
{
if ((flags & SEC_LOAD) == 0)
newsect->lma = (phdr->p_paddr