summaryrefslogtreecommitdiff
path: root/bfd/elf32-rx.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2012-05-11 00:01:58 +0000
committerDJ Delorie <dj@delorie.com>2012-05-11 00:01:58 +0000
commit41eac08e8cdad7297284a653f900c2fedaee622f (patch)
treeef4e95c073495a3717c0362c9a58230a1fbb1a08 /bfd/elf32-rx.c
parent8d02b48eaa07e9ad5ba0f334dec9080d0cf04f85 (diff)
downloadbinutils-redhat-41eac08e8cdad7297284a653f900c2fedaee622f.tar.gz
* elf32-rx.c (rx_elf_object_p): Ignore empty segments.
Diffstat (limited to 'bfd/elf32-rx.c')
-rw-r--r--bfd/elf32-rx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c
index e74f5465d9..d3b71c317e 100644
--- a/bfd/elf32-rx.c
+++ b/bfd/elf32-rx.c
@@ -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);