Fix a translation problem for the text generated by readelf at the start of a dump...
authorNick Clifton <nickc@redhat.com>
Mon, 12 Jul 2021 13:14:33 +0000 (14:14 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 12 Jul 2021 13:14:33 +0000 (14:14 +0100)
PR 28072
binutils * readelf.c (process_dynamic_section): Use ngettext to help with translation of header text.

binutils/readelf.c

index 24ff069edf49a406db1256e5266639e1f3a78d2b..5682837ed7b38df440dfaa8c6e13c21d61ebed8e 100644 (file)
@@ -10943,28 +10943,19 @@ the .dynstr section doesn't match the DT_STRTAB and DT_STRSZ tags\n"));
 
   if (do_dynamic && filedata->dynamic_addr)
     {
-      if (filedata->dynamic_nent == 1)
-       {
-         if (filedata->is_separate)
-           printf (_("\nIn linked file '%s' the dynamic section at offset 0x%lx contains 1 entry:\n"),
-                   filedata->file_name,
-                   filedata->dynamic_addr);
-         else
-           printf (_("\nDynamic section at offset 0x%lx contains 1 entry:\n"),
-                   filedata->dynamic_addr);
-       }
-      else
-       {
-         if (filedata->is_separate)
-           printf (_("\nIn linked file '%s' the dynamic section at offset 0x%lx contains %lu entries:\n"),
-                   filedata->file_name,
-                   filedata->dynamic_addr,
-                   (unsigned long) filedata->dynamic_nent);
+      if (filedata->is_separate)
+       printf (ngettext ("\nIn linked file '%s' the dynamic section at offset 0x%lx contains %lu entry:\n",
+                         "\nIn linked file '%s' the dynamic section at offset 0x%lx contains %lu entries:\n",
+                         (unsigned long) filedata->dynamic_nent),
+               filedata->file_name,
+               filedata->dynamic_addr,
+               (unsigned long) filedata->dynamic_nent);
          else
-           printf (_("\nDynamic section at offset 0x%lx contains %lu entries:\n"),
+           printf (ngettext ("\nDynamic section at offset 0x%lx contains %lu entry:\n",
+                             "\nDynamic section at offset 0x%lx contains %lu entries:\n",
+                             (unsigned long) filedata->dynamic_nent),
                    filedata->dynamic_addr,
                    (unsigned long) filedata->dynamic_nent);
-       }
     }
   if (do_dynamic)
     printf (_("  Tag        Type                         Name/Value\n"));
@@ -17295,24 +17286,27 @@ display_csky_attribute (unsigned char * p,
       break;
     case Tag_CSKY_FPU_ROUNDING:
       READ_ULEB (val, p, end);
-      if (val == 1) {
-       printf ("  Tag_CSKY_FPU_ROUNDING:\t");
-       printf ("Needed\n");
-      }
+      if (val == 1)
+       {
+         printf ("  Tag_CSKY_FPU_ROUNDING:\t");
+         printf ("Needed\n");
+       }
       break;
     case Tag_CSKY_FPU_DENORMAL:
       READ_ULEB (val, p, end);
-      if (val == 1) {
-       printf ("  Tag_CSKY_FPU_DENORMAL:\t");
-       printf ("Needed\n");
-      }
+      if (val == 1)
+       {
+         printf ("  Tag_CSKY_FPU_DENORMAL:\t");
+         printf ("Needed\n");
+       }
       break;
     case Tag_CSKY_FPU_Exception:
       READ_ULEB (val, p, end);
-      if (val == 1) {
-       printf ("  Tag_CSKY_FPU_Exception:\t");
-       printf ("Needed\n");
-      }
+      if (val == 1)
+       {
+         printf ("  Tag_CSKY_FPU_Exception:\t");
+         printf ("Needed\n");
+       }
       break;
     case Tag_CSKY_FPU_NUMBER_MODULE:
       printf ("  Tag_CSKY_FPU_NUMBER_MODULE:\t");