This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
rx: ignore empty segments
- From: DJ Delorie <dj at redhat dot com>
- To: binutils at sourceware dot org
- Date: Thu, 10 May 2012 20:02:01 -0400
- Subject: rx: ignore empty segments
Applied.
* elf32-rx.c (rx_elf_object_p): Ignore empty segments.
Index: bfd/elf32-rx.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-rx.c,v
retrieving revision 1.18
diff -p -U5 -r1.18 elf32-rx.c
--- bfd/elf32-rx.c 7 May 2012 03:27:50 -0000 1.18
+++ bfd/elf32-rx.c 10 May 2012 23:35:21 -0000
@@ -3058,11 +3058,12 @@ rx_elf_object_p (bfd * abfd)
{
for (u=0; u<elf_tdata(abfd)->num_elf_sections; u++)
{
Elf_Internal_Shdr *sec = elf_tdata(abfd)->elf_sect_ptr[u];
- if (phdr[i].p_offset <= (bfd_vma) sec->sh_offset
+ if (phdr[i].p_filesz
+ && phdr[i].p_offset <= (bfd_vma) sec->sh_offset
&& (bfd_vma)sec->sh_offset <= phdr[i].p_offset + (phdr[i].p_filesz - 1))
{
/* Found one! The difference between the two addresses,
plus the difference between the two file offsets, is
enough information to reconstruct the lma. */
@@ -3082,11 +3083,12 @@ rx_elf_object_p (bfd * abfd)
/* We must update the bfd sections as well, so we don't stop
with one match. */
bsec = abfd->sections;
while (bsec)
{
- if (phdr[i].p_vaddr <= bsec->vma
+ if (phdr[i].p_filesz
+ && phdr[i].p_vaddr <= bsec->vma
&& bsec->vma <= phdr[i].p_vaddr + (phdr[i].p_filesz - 1))
{
bsec->lma = phdr[i].p_paddr + (bsec->vma - phdr[i].p_vaddr);
}
bsec = bsec->next;