Improve warning message from debuginfod support in readelf.
* readelf.c (get_build_id): Simplify warning message about corrupt notes encountered whilst scanning for the build-id.
This commit is contained in:
parent
738174e17e
commit
55be8fd0d2
2 changed files with 21 additions and 21 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
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.
|
||||||
|
|
||||||
2020-01-27 Roland McGrath <mcgrathr@google.com>
|
2020-01-27 Roland McGrath <mcgrathr@google.com>
|
||||||
|
|
||||||
* objcopy.c (compare_gnu_build_notes): Fix comparison results
|
* objcopy.c (compare_gnu_build_notes): Fix comparison results
|
||||||
|
|
|
@ -14122,7 +14122,7 @@ load_specific_debug_section (enum dwarf_section_display_enum debug,
|
||||||
? sizeof (Elf32_External_Chdr)
|
? sizeof (Elf32_External_Chdr)
|
||||||
: sizeof (Elf64_External_Chdr)))
|
: sizeof (Elf64_External_Chdr)))
|
||||||
{
|
{
|
||||||
warn (_("compressed section %s is too small to contain a compression header"),
|
warn (_("compressed section %s is too small to contain a compression header\n"),
|
||||||
section->name);
|
section->name);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -14204,7 +14204,8 @@ get_build_id (void * data)
|
||||||
Elf_Internal_Shdr * shdr;
|
Elf_Internal_Shdr * shdr;
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
|
|
||||||
/* Iterate through notes to find note.gnu.build-id. */
|
/* Iterate through notes to find note.gnu.build-id.
|
||||||
|
FIXME: Only the first note in any note section is examined. */
|
||||||
for (i = 0, shdr = filedata->section_headers;
|
for (i = 0, shdr = filedata->section_headers;
|
||||||
i < filedata->file_header.e_shnum && shdr != NULL;
|
i < filedata->file_header.e_shnum && shdr != NULL;
|
||||||
i++, shdr++)
|
i++, shdr++)
|
||||||
|
@ -14240,13 +14241,10 @@ get_build_id (void * data)
|
||||||
min_notesz = offsetof (Elf_External_Note, name);
|
min_notesz = offsetof (Elf_External_Note, name);
|
||||||
if (data_remaining < min_notesz)
|
if (data_remaining < min_notesz)
|
||||||
{
|
{
|
||||||
warn (ngettext ("debuginfod: Corrupt note: only %ld byte remains, "
|
warn (_("\
|
||||||
"not enough for a full note\n",
|
malformed note encountered in section %s whilst scanning for build-id note\n"),
|
||||||
"debuginfod: Corrupt note: only %ld bytes remain, "
|
printable_section_name (filedata, shdr));
|
||||||
"not enough for a full note\n",
|
continue;
|
||||||
data_remaining),
|
|
||||||
(long) data_remaining);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
data_remaining -= min_notesz;
|
data_remaining -= min_notesz;
|
||||||
|
|
||||||
|
@ -14269,13 +14267,10 @@ get_build_id (void * data)
|
||||||
min_notesz = offsetof (Elf64_External_VMS_Note, name);
|
min_notesz = offsetof (Elf64_External_VMS_Note, name);
|
||||||
if (data_remaining < min_notesz)
|
if (data_remaining < min_notesz)
|
||||||
{
|
{
|
||||||
warn (ngettext ("debuginfod: Corrupt note: only %ld byte remains, "
|
warn (_("\
|
||||||
"not enough for a full note\n",
|
malformed note encountered in section %s whilst scanning for build-id note\n"),
|
||||||
"debuginfod: Corrupt note: only %ld bytes remain, "
|
printable_section_name (filedata, shdr));
|
||||||
"not enough for a full note\n",
|
continue;
|
||||||
data_remaining),
|
|
||||||
(long) data_remaining);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
data_remaining -= min_notesz;
|
data_remaining -= min_notesz;
|
||||||
|
|
||||||
|
@ -14296,9 +14291,9 @@ get_build_id (void * data)
|
||||||
|| ((size_t) (next - inote.descdata)
|
|| ((size_t) (next - inote.descdata)
|
||||||
> data_remaining - (size_t) (inote.descdata - inote.namedata)))
|
> data_remaining - (size_t) (inote.descdata - inote.namedata)))
|
||||||
{
|
{
|
||||||
warn (_("debuginfod: note with invalid namesz and/or descsz found\n"));
|
warn (_("\
|
||||||
warn (_(" type: 0x%lx, namesize: 0x%08lx, descsize: 0x%08lx, alignment: %u\n"),
|
malformed note encountered in section %s whilst scanning for build-id note\n"),
|
||||||
inote.type, inote.namesz, inote.descsz, (int) align);
|
printable_section_name (filedata, shdr));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14313,13 +14308,13 @@ get_build_id (void * data)
|
||||||
|
|
||||||
build_id = malloc (inote.descsz * 2 + 1);
|
build_id = malloc (inote.descsz * 2 + 1);
|
||||||
if (build_id == NULL)
|
if (build_id == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (j = 0; j < inote.descsz; ++j)
|
for (j = 0; j < inote.descsz; ++j)
|
||||||
sprintf (build_id + (j * 2), "%02x", inote.descdata[j] & 0xff);
|
sprintf (build_id + (j * 2), "%02x", inote.descdata[j] & 0xff);
|
||||||
build_id[inote.descsz * 2] = '\0';
|
build_id[inote.descsz * 2] = '\0';
|
||||||
|
|
||||||
return (unsigned char *)build_id;
|
return (unsigned char *) build_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue