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] bfd, sparc: avoid duplicated error messages on invalid relocations.


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

commit e920c014ecd9fbb630c76576d2771aa4631d93f7
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Tue Sep 4 20:19:06 2018 +0200

    bfd, sparc: avoid duplicated error messages on invalid relocations.
    
    This patch avoids a duplicated error message when an invalid
    relocation number is read from an object file in sparc-* ELF targets:
    
    $ strip -g test.o
    strip: test.o: unsupported relocation type 0xd7
    strip: test.o: unsupported relocation type 0xd7
    strip: test.o: bad value
    
    Tested in x86_64-linux-gnu, sparc64-linux-gnu and sparc-linux-gnu
    targets.
    
    bfd/ChangeLog:
    
    2018-09-04  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
    	* elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Do not issue an
    	error when an invalid relocation is passed;  this is already done
    	by `_bfd_sparc_elf_info_to_howto_ptr'.

Diff:
---
 bfd/ChangeLog     | 6 ++++++
 bfd/elfxx-sparc.c | 2 --
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 22837e0..bc1cb15 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
 2018-09-04  Jose E. Marchesi  <jose.marchesi@oracle.com>
 
+	* elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Do not issue an
+	error when an invalid relocation is passed;  this is already done
+	by `_bfd_sparc_elf_info_to_howto_ptr'.
+
+2018-09-04  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
 	* elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Issue an
 	error when an invalid symbol index is retrieved in ELF64_R_SYM of
 	a relocation seen in an input file.
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 81812af..bf143c4 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -658,8 +658,6 @@ _bfd_sparc_elf_info_to_howto (bfd *abfd, arelent *cache_ptr,
 
   if ((cache_ptr->howto = _bfd_sparc_elf_info_to_howto_ptr (abfd, r_type)) == NULL)
     {
-      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
-			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }


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