This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Manually checking build id in elf files
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Alex Bennee <kernel-hacker at bennee dot com>
- Cc: gdb at sourceware dot org
- Date: Thu, 3 Sep 2009 15:11:00 +0200
- Subject: Re: Manually checking build id in elf files
- References: <b2cdc9f30909030603l7ae20355hcb5615b1387358c4@mail.gmail.com>
On Thu, 03 Sep 2009 15:03:05 +0200, Alex Bennee wrote:
> I'd like to manually check it but readelf doesn't show any such notes:
>
> vnms@vnms:~$ readelf -n /usr/lib/libcairo.so.2.17.3
> vnms@vnms:~$ readelf -n /usr/lib/debug/usr/lib/libcairo.so.2.17.3
Try elfutils:
# eu-readelf -n /lib64/libc.so.6
Note section [ 1] '.note.gnu.build-id' of 36 bytes at offset 0x270:
Owner Data size Type
GNU 20 GNU_BUILD_ID
Build ID: ec8dd400904ddfcac8b1c343263a790f977159dc
[...]
# eu-unstrip -n -e /lib64/libc.so.6
0x3979600000+0x36d868 ec8dd400904ddfcac8b1c343263a790f977159dc@0x3979600280 /lib64/libc.so.6 /usr/lib/debug/lib64/libc-2.10.1.so.debug
> Am I missing something? Is there a way to use readelf to read this information?
>From binutils you can use objdump:
# objdump -s -j .note.gnu.build-id /lib64/libc.so.6
[...]
Contents of section .note.gnu.build-id:
3979600270 04000000 14000000 03000000 474e5500 ............GNU.
----------->
3979600280 ec8dd400 904ddfca c8b1c343 263a790f .....M.....C&:y.
3979600290 977159dc .qY.
Regards,
Jan