This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] rx: Fix p_vaddr reconstruction logic.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7859afc4fa05f6876c4e6b95cfb8fc252efd96bc

commit 7859afc4fa05f6876c4e6b95cfb8fc252efd96bc
Author: DJ Delorie <dj@redhat.com>
Date:   Tue Dec 8 01:15:58 2015 -0500

    rx: Fix p_vaddr reconstruction logic.
    
    * elf32-rx.c (rx_elf_object_p): Ignore empty and nobits sections.

Diff:
---
 bfd/ChangeLog  | 4 ++++
 bfd/elf32-rx.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 90b61db..180f363 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2015-12-08  DJ Delorie  <dj@redhat.com>
+
+	* elf32-rx.c (rx_elf_object_p): Ignore empty and nobits sections.
+
 2015-12-07  Nick Clifton  <nickc@redhat.com>
 
 	* elf32-rx.c (elf32_rx_relax_delete_bytes): Add extra parameter -
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,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]