binutils
* readelf.c (get_note_type): Handle NT_SIGINFO, NT_FILE. (print_core_note): New function. (process_note): Call it. include/common/elf * common.h (NT_SIGINFO, NT_FILE): New defines.
This commit is contained in:
parent
545f743d64
commit
9ece1fa991
|
@ -1,3 +1,9 @@
|
|||
2012-10-23 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* readelf.c (get_note_type): Handle NT_SIGINFO, NT_FILE.
|
||||
(print_core_note): New function.
|
||||
(process_note): Call it.
|
||||
|
||||
2012-10-21 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* objdump.c (dump_dwarf): Handle bfd_mach_x64_32 and
|
||||
|
|
|
@ -12612,6 +12612,10 @@ get_note_type (unsigned e_type)
|
|||
return _("NT_LWPSINFO (lwpsinfo_t structure)");
|
||||
case NT_WIN32PSTATUS:
|
||||
return _("NT_WIN32PSTATUS (win32_pstatus structure)");
|
||||
case NT_SIGINFO:
|
||||
return _("NT_SIGINFO (siginfo_t data)");
|
||||
case NT_FILE:
|
||||
return _("NT_FILE (mapped files)");
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -12630,6 +12634,92 @@ get_note_type (unsigned e_type)
|
|||
return buff;
|
||||
}
|
||||
|
||||
static int
|
||||
print_core_note (Elf_Internal_Note *pnote)
|
||||
{
|
||||
unsigned int addr_size = is_32bit_elf ? 4 : 8;
|
||||
bfd_vma count, page_size;
|
||||
unsigned char *descdata, *filenames, *descend;
|
||||
|
||||
if (pnote->type != NT_FILE)
|
||||
return 1;
|
||||
|
||||
#ifndef BFD64
|
||||
if (!is_32bit_elf)
|
||||
{
|
||||
printf (_(" Cannot decode 64-bit note in 32-bit build\n"));
|
||||
/* Still "successful". */
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pnote->descsz < 2 * addr_size)
|
||||
{
|
||||
printf (_(" Malformed note - too short for header\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
descdata = (unsigned char *) pnote->descdata;
|
||||
descend = descdata + pnote->descsz;
|
||||
|
||||
if (descdata[pnote->descsz - 1] != '\0')
|
||||
{
|
||||
printf (_(" Malformed note - does not end with \\0\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
count = byte_get (descdata, addr_size);
|
||||
descdata += addr_size;
|
||||
|
||||
page_size = byte_get (descdata, addr_size);
|
||||
descdata += addr_size;
|
||||
|
||||
if (pnote->descsz < 2 * addr_size + count * 3 * addr_size)
|
||||
{
|
||||
printf (_(" Malformed note - too short for supplied file count\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf (_(" Page size: "));
|
||||
print_vma (page_size, DEC);
|
||||
printf ("\n");
|
||||
|
||||
printf (_(" %*s%*s%*s\n"),
|
||||
(int) (2 + 2 * addr_size), _("Start"),
|
||||
(int) (4 + 2 * addr_size), _("End"),
|
||||
(int) (4 + 2 * addr_size), _("Page Offset"));
|
||||
filenames = descdata + count * 3 * addr_size;
|
||||
while (--count > 0)
|
||||
{
|
||||
bfd_vma start, end, file_ofs;
|
||||
|
||||
if (filenames == descend)
|
||||
{
|
||||
printf (_(" Malformed note - filenames end too early\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
start = byte_get (descdata, addr_size);
|
||||
descdata += addr_size;
|
||||
end = byte_get (descdata, addr_size);
|
||||
descdata += addr_size;
|
||||
file_ofs = byte_get (descdata, addr_size);
|
||||
descdata += addr_size;
|
||||
|
||||
printf (" ");
|
||||
print_vma (start, FULL_HEX);
|
||||
printf (" ");
|
||||
print_vma (end, FULL_HEX);
|
||||
printf (" ");
|
||||
print_vma (file_ofs, FULL_HEX);
|
||||
printf ("\n %s\n", filenames);
|
||||
|
||||
filenames += 1 + strlen ((char *) filenames);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_gnu_elf_note_type (unsigned e_type)
|
||||
{
|
||||
|
@ -12990,6 +13080,8 @@ process_note (Elf_Internal_Note * pnote)
|
|||
return print_gnu_note (pnote);
|
||||
else if (const_strneq (pnote->namedata, "stapsdt"))
|
||||
return print_stapsdt_note (pnote);
|
||||
else if (const_strneq (pnote->namedata, "CORE"))
|
||||
return print_core_note (pnote);
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2012-10-23 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* common.h (NT_SIGINFO, NT_FILE): New defines.
|
||||
|
||||
2012-08-27 Walter Lee <walt@tilera.com>
|
||||
|
||||
* tilegx.h (R_TILEGX_IMM16_X0_HW0_PLT_PCREL): New relocation.
|
||||
|
|
|
@ -549,6 +549,8 @@
|
|||
/* note name must be "LINUX". */
|
||||
#define NT_ARM_VFP 0x400 /* ARM VFP registers */
|
||||
/* note name must be "LINUX". */
|
||||
#define NT_SIGINFO 0x53494749 /* Fields of siginfo_t. */
|
||||
#define NT_FILE 0x46494c45 /* Description of mapped files. */
|
||||
|
||||
/* Note segments for core files on dir-style procfs systems. */
|
||||
|
||||
|
|
Loading…
Reference in New Issue