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] PowerPC64 statistics message


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

commit db84fff3f888bb3e6d51ad24b6bfa2c6e2c3a206
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Nov 6 15:21:53 2017 +1030

    PowerPC64 statistics message
    
    Fixes "linker stubs in 1 groups".
    
    	* elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
    	statistics message.

Diff:
---
 bfd/ChangeLog   |  5 +++++
 bfd/elf64-ppc.c | 23 +++++++++++++----------
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 705179a..9e820c5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
 2017-11-07  Alan Modra  <amodra@gmail.com>
 
+	* elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
+	statistics message.
+
+2017-11-07  Alan Modra  <amodra@gmail.com>
+
 	* sysdep.h: Formatting, comment fixes.
 	(gettext, ngettext): Redefine when ENABLE_NLS.
 	(ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 31cb2f2..1cf7964 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -13303,20 +13303,23 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
 
   if (stats != NULL)
     {
+      size_t len;
       *stats = bfd_malloc (500);
       if (*stats == NULL)
 	return FALSE;
 
-      sprintf (*stats, _("linker stubs in %u group%s\n"
-			 "  branch       %lu\n"
-			 "  toc adjust   %lu\n"
-			 "  long branch  %lu\n"
-			 "  long toc adj %lu\n"
-			 "  plt call     %lu\n"
-			 "  plt call toc %lu\n"
-			 "  global entry %lu"),
-	       stub_sec_count,
-	       stub_sec_count == 1 ? "" : "s",
+      len = sprintf (*stats,
+		     ngettext ("linker stubs in %u group\n",
+			       "linker stubs in %u groups\n",
+			       stub_sec_count),
+		     stub_sec_count);
+      sprintf (*stats + len, _("  branch       %lu\n"
+			       "  toc adjust   %lu\n"
+			       "  long branch  %lu\n"
+			       "  long toc adj %lu\n"
+			       "  plt call     %lu\n"
+			       "  plt call toc %lu\n"
+			       "  global entry %lu"),
 	       htab->stub_count[ppc_stub_long_branch - 1],
 	       htab->stub_count[ppc_stub_long_branch_r2off - 1],
 	       htab->stub_count[ppc_stub_plt_branch - 1],


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