Hi,
Another small addition to make it possible to print the new sdt elf notes that are appearing in more and more binaries these days. The format is fairly simple to parse and has been added to the appropriate libebl functions. ebl_object_note_type_name () has been changed to also take the name of the note as argument, to facilitate printing the type depending on name.
libebl/ * libebl.h (ebl_object_note_type_name): Add const char *name arg. * eblhooks.h (object_note_type_name): Likewise. * eblopenbackend.c (default_object_note_type_name): Likewise. * eblobjnotetypename.c (ebl_object_note_type_name): Likewise. And print version if name is "stapsdt". * eblobjnote.c (ebl_object_note): Add output for "stapsdt" notes. src/ * readelf.c (handle_notes_data): Call ebl_object_note_type_name with note name.
Sample output of readelf -n:
Note section [35] '.note.stapsdt' of 708 bytes at offset 0x1c0: Owner Data size Type stapsdt 51 Version: 3 PC: 0x2f690, Base: 0x158368, Semaphore: 0 Provider: libc, Name: setjmp, Args: '4@%eax -4@4+4(%esp) 4@%ecx' stapsdt 44 Version: 3 PC: 0x2f730, Base: 0x158368, Semaphore: 0 Provider: libc, Name: setjmp, Args: '4@%eax -4@$1 4@%ecx' stapsdt 44 Version: 3 PC: 0x2f772, Base: 0x158368, Semaphore: 0 Provider: libc, Name: setjmp, Args: '4@%edx -4@$0 4@%ecx' stapsdt 50 Version: 3 PC: 0x2f80e, Base: 0x158368, Semaphore: 0 Provider: libc, Name: longjmp, Args: '4@%eax -4@8(%esp) 4@%edx' stapsdt 57 Version: 3 PC: 0x2f81a, Base: 0x158368, Semaphore: 0 Provider: libc, Name: longjmp_target, Args: '4@%eax -4@8(%esp) 4@%edx' stapsdt 51 Version: 3 [...]
Please let me know if you see any issues with the implementation before I commit it. Patch attached and on the mjw/sdt git branch.
Thanks,
Mark
On Tue, 2011-04-26 at 12:36 +0200, Mark Wielaard wrote:
libebl/ * libebl.h (ebl_object_note_type_name): Add const char *name arg. * eblhooks.h (object_note_type_name): Likewise. * eblopenbackend.c (default_object_note_type_name): Likewise. * eblobjnotetypename.c (ebl_object_note_type_name): Likewise. And print version if name is "stapsdt". * eblobjnote.c (ebl_object_note): Add output for "stapsdt" notes. src/ * readelf.c (handle_notes_data): Call ebl_object_note_type_name with note name. [...] Please let me know if you see any issues with the implementation before I commit it. Patch attached and on the mjw/sdt git branch.
I pushed this change.
Cheers,
Mark
elfutils-devel@lists.fedorahosted.org