Strange singular/plural messages in 2.33.90

Nick Clifton nickc@redhat.com
Tue Jan 28 11:35:00 GMT 2020


Hi Alan,

> OK, I'll drop my patch then.  It was one I'd made before you committed
> your fix for the singular/plural inconsistency, and my only interest
> remaining in the patch was to reduce translation work..

Fair enough.  I have checked in a replacement that uses a single
repeated message in all three locations, which should help with
the translation too.

Cheers
  Nick

binutils/ChangeLog
2020-01-28  Nick Clifton  <nickc@redhat.com>

	* readelf.c (get_build_id): Simplify warning message about corrupt
	notes encountered whilst scanning for the build-id.

diff --git a/binutils/readelf.c b/binutils/readelf.c
index eabb70fac9..45cfe1cfcf 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -14240,13 +14241,10 @@ get_build_id (void * data)
           min_notesz = offsetof (Elf_External_Note, name);
           if (data_remaining < min_notesz)
             {
-              warn (ngettext ("debuginfod: Corrupt note: only %ld byte remains, "
-                              "not enough for a full note\n",
-                              "debuginfod: Corrupt note: only %ld bytes remain, "
-                              "not enough for a full note\n",
-                              data_remaining),
-                    (long) data_remaining);
-              break;
+	      warn (_("\
+malformed note encountered in section %s whilst scanning for build-id note\n"),
+		    printable_section_name (filedata, shdr));
+              continue;
             }
           data_remaining -= min_notesz;
 
@@ -14269,13 +14267,10 @@ get_build_id (void * data)
           min_notesz = offsetof (Elf64_External_VMS_Note, name);
           if (data_remaining < min_notesz)
             {
-              warn (ngettext ("debuginfod: Corrupt note: only %ld byte remains, "
-                              "not enough for a full note\n",
-                              "debuginfod: Corrupt note: only %ld bytes remain, "
-                              "not enough for a full note\n",
-                              data_remaining),
-                    (long) data_remaining);
-              break;
+	      warn (_("\
+malformed note encountered in section %s whilst scanning for build-id note\n"),
+		    printable_section_name (filedata, shdr));
+              continue;
             }
           data_remaining -= min_notesz;
 
@@ -14296,9 +14291,9 @@ get_build_id (void * data)
           || ((size_t) (next - inote.descdata)
               > data_remaining - (size_t) (inote.descdata - inote.namedata)))
         {
-          warn (_("debuginfod: note with invalid namesz and/or descsz found\n"));
-          warn (_(" type: 0x%lx, namesize: 0x%08lx, descsize: 0x%08lx, alignment: %u\n"),
-                inote.type, inote.namesz, inote.descsz, (int) align);
+	  warn (_("\
+malformed note encountered in section %s whilst scanning for build-id note\n"),
+		printable_section_name (filedata, shdr));
           continue;
         }
 



More information about the Binutils mailing list