* elf32-rx.c (rx_elf_object_p): Ignore empty segments.
authorDJ Delorie <dj@redhat.com>
Fri, 11 May 2012 00:01:58 +0000 (00:01 +0000)
committerDJ Delorie <dj@redhat.com>
Fri, 11 May 2012 00:01:58 +0000 (00:01 +0000)
bfd/ChangeLog
bfd/elf32-rx.c

index a46ed85e1606043ee09931b6f4b22f26e2343f23..806db7f1e73da2a8eff3e5bf256697df8e046819 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-10  DJ Delorie  <dj@redhat.com>
+
+       * elf32-rx.c (rx_elf_object_p): Ignore empty segments.
+
 2012-05-10  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf64-x86-64.c (elf_x86_64_relocate_section): Display signed
index e74f5465d9197a1c896f0e3d57c5870d8ad8c8a2..d3b71c317e8026b50af904adf27d79363a5c6850 100644 (file)
@@ -3060,7 +3060,8 @@ rx_elf_object_p (bfd * abfd)
        {
          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,
@@ -3084,7 +3085,8 @@ rx_elf_object_p (bfd * abfd)
       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);