Strange singular/plural messages in 2.33.90

Alan Modra amodra@gmail.com
Mon Jan 27 12:15:00 GMT 2020


On Fri, Jan 24, 2020 at 11:56:40AM +0000, Nick Clifton wrote:
> binutils/ChangeLog
> 2020-01-24  Nick Clifton  <nickc@redhat.com>
> 
> 	* readelf.c (get_build_id): Fix warning messages about corrupt
> 	notes.

Is there a need to report "debuginfod: "?  I'm thinking we could
consolidate these messages a little to cut down on translation work.
OK?  (-w diff shown to exclude all the leading space to tab changes)

            * readelf.c (get_build_id): Formatting.  Remove "debuginfod" from
            error messages.  Report file offset for invalid note.
            (process_notes_at): Report file offset rather than section offset
            for invalid note.

diff --git a/binutils/readelf.c b/binutils/readelf.c
index eabb70fac9..3bbd1d5236 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -14240,9 +14240,9 @@ 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, "
+	      warn (ngettext ("Corrupt note: only %ld byte remains, "
 			      "not enough for a full note\n",
-                              "debuginfod: Corrupt note: only %ld bytes remain, "
+			      "Corrupt note: only %ld bytes remain, "
 			      "not enough for a full note\n",
 			      data_remaining),
 		    (long) data_remaining);
@@ -14269,9 +14269,9 @@ 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, "
+	      warn (ngettext ("Corrupt note: only %ld byte remains, "
 			      "not enough for a full note\n",
-                              "debuginfod: Corrupt note: only %ld bytes remain, "
+			      "Corrupt note: only %ld bytes remain, "
 			      "not enough for a full note\n",
 			      data_remaining),
 		    (long) data_remaining);
@@ -14296,8 +14296,11 @@ 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"),
+	  warn (_("note with invalid namesz and/or descsz found\n"
+		  " at offset 0x%lx\n"
+		  " type: 0x%lx, namesize: 0x%08lx, descsize: 0x%08lx,"
+		  " alignment: %u\n"),
+		(unsigned long) offset,
 		inote.type, inote.namesz, inote.descsz, (int) align);
 	  continue;
 	}
@@ -19428,9 +19431,11 @@ process_notes_at (Filedata *           filedata,
 	  || ((size_t) (next - inote.descdata)
 	      > data_remaining - (size_t) (inote.descdata - inote.namedata)))
 	{
-	  warn (_("note with invalid namesz and/or descsz found at offset 0x%lx\n"),
-		(unsigned long) ((char *) external - (char *) pnotes));
-	  warn (_(" type: 0x%lx, namesize: 0x%08lx, descsize: 0x%08lx, alignment: %u\n"),
+	  warn (_("note with invalid namesz and/or descsz found"
+		  " at offset 0x%lx\n"
+		  " type: 0x%lx, namesize: 0x%08lx, descsize: 0x%08lx,"
+		  " alignment: %u\n"),
+		(unsigned long) offset + ((char *) external - (char *) pnotes),
 		inote.type, inote.namesz, inote.descsz, (int) align);
 	  break;
 	}

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list