This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[rx] Fix p_vaddr reconstruction logic.
- From: DJ Delorie <dj at redhat dot com>
- To: binutils at sourceware dot org
- Date: Tue, 8 Dec 2015 01:19:01 -0500
- Subject: [rx] Fix p_vaddr reconstruction logic.
- Authentication-results: sourceware.org; auth=none
We should only look at "real" contents when trying to guess the
address offsets. Committed.
* elf32-rx.c (rx_elf_object_p): Ignore empty and nobits sections.
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c
index 004d7c2..0fe853d 100644
--- a/bfd/elf32-rx.c
+++ b/bfd/elf32-rx.c
@@ -3229,6 +3229,8 @@ rx_elf_object_p (bfd * abfd)
if (phdr[i].p_filesz
&& phdr[i].p_offset <= (bfd_vma) sec->sh_offset
+ && sec->sh_size > 0
+ && sec->sh_type != SHT_NOBITS
&& (bfd_vma)sec->sh_offset <= phdr[i].p_offset + (phdr[i].p_filesz - 1))
{
/* Found one! The difference between the two addresses,