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] Miscellaneous format string fixes


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

commit cd9af601e60240bb38dc58ce7e69abd5f2972ec7
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Jul 3 21:56:29 2017 +0930

    Miscellaneous format string fixes
    
    	* elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
    	print d_tag.
    	(bfd_elf_print_symbol): Don't cast symbol->flags.
    	(_bfd_elf_symbol_from_bfd_symbol): Likewise.
    	* elf32-ppc.c (ppc_elf_begin_write_processing): Correct
    	_bfd_error_handler argument order.
    	(ppc_elf_merge_private_bfd_data): Don't cast flags.

Diff:
---
 bfd/ChangeLog   | 10 ++++++++++
 bfd/elf.c       |  8 ++++----
 bfd/elf32-ppc.c |  8 ++++----
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 271cc1c..b1e5e65 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,15 @@
 2017-07-03  Alan Modra  <amodra@gmail.com>
 
+	* elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
+	print d_tag.
+	(bfd_elf_print_symbol): Don't cast symbol->flags.
+	(_bfd_elf_symbol_from_bfd_symbol): Likewise.
+	* elf32-ppc.c (ppc_elf_begin_write_processing): Correct
+	_bfd_error_handler argument order.
+	(ppc_elf_merge_private_bfd_data): Don't cast flags.
+
+2017-07-03  Alan Modra  <amodra@gmail.com>
+
 	* configure.ac: Invoke AC_CHECK_TYPES for long long.  Invoke
 	AC_TYPE_LONG_DOUBLE.
 	* configure: Regenerate.
diff --git a/bfd/elf.c b/bfd/elf.c
index a238d39..9fec4b5 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1669,7 +1669,7 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg)
 
 	      if (!strcmp (name, ""))
 		{
-		  sprintf (ab, "0x%lx", (unsigned long) dyn.d_tag);
+		  sprintf (ab, "%#" BFD_VMA_FMT "x", dyn.d_tag);
 		  name = ab;
 		}
 	      break;
@@ -1879,7 +1879,7 @@ bfd_elf_print_symbol (bfd *abfd,
     case bfd_print_symbol_more:
       fprintf (file, "elf ");
       bfd_fprintf_vma (abfd, file, symbol->value);
-      fprintf (file, " %lx", (unsigned long) symbol->flags);
+      fprintf (file, " %x", symbol->flags);
       break;
     case bfd_print_symbol_all:
       {
@@ -6426,8 +6426,8 @@ _bfd_elf_symbol_from_bfd_symbol (bfd *abfd, asymbol **asym_ptr_ptr)
 #if DEBUG & 4
   {
     fprintf (stderr,
-	     "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx\n",
-	     (long) asym_ptr, asym_ptr->name, idx, (long) flags);
+	     "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8x\n",
+	     (long) asym_ptr, asym_ptr->name, idx, flags);
     fflush (stderr);
   }
 #endif
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index a4814fc..0e99272 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2849,7 +2849,7 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info)
     free (buffer);
 
   if (error_message)
-    _bfd_error_handler (error_message, ibfd, APUINFO_SECTION_NAME);
+    _bfd_error_handler (error_message, APUINFO_SECTION_NAME, ibfd);
 }
 
 /* Prevent the output section from accumulating the input sections'
@@ -4906,9 +4906,9 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
 	  error = TRUE;
 	  _bfd_error_handler
 	    /* xgettext:c-format */
-	    (_("%B: uses different e_flags (0x%lx) fields "
-	       "than previous modules (0x%lx)"),
-	     ibfd, (long) new_flags, (long) old_flags);
+	    (_("%B: uses different e_flags (%#x) fields "
+	       "than previous modules (%#x)"),
+	     ibfd, new_flags, old_flags);
 	}
 
       if (error)


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