Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Alex Bennee <kernel-hacker@bennee.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: Manually checking build id in elf files
Date: Thu, 03 Sep 2009 13:45:00 -0000	[thread overview]
Message-ID: <b2cdc9f30909030645g465bccfbx977072b16953353c@mail.gmail.com> (raw)
In-Reply-To: <20090903131100.GA27450@host0.dyn.jankratochvil.net>

2009/9/3 Jan Kratochvil <jan.kratochvil@redhat.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:

heh, there was me assuming readelf was part of 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

I do seem to be seeing different output:

vnms@vnms:~$ eu-unstrip -n -e /lib/libc-2.7.so
0+0x361278 - /lib/libc-2.7.so /usr/lib/debug/lib/libc-2.7.so
vnms@vnms:~$ eu-readelf -n /lib/libc-2.7.so

Note section [ 1] '.note.ABI-tag' of 32 bytes at offset 0x270:
  Owner          Data size  Type
  GNU                   16  VERSION
    OS: Linux, ABI: 2.6.8
vnms@vnms:~$ objdump -s -j .note.gnu.build-id /lib/libc.so.6

/lib/libc.so.6:     file format elf64-x86-64

vnms@vnms:~$ eu-unstrip -n -e /lib/libc-2.7.so
0+0x361278 - /lib/libc-2.7.so /usr/lib/debug/lib/libc-2.7.so
vnms@vnms:~$ eu-readelf -n /usr/lib/libcairo.so.2.17.3
vnms@vnms:~$ objdump -s -j .note.gnu.build-id /usr/lib/libcairo.so.2.17.3

/usr/lib/libcairo.so.2.17.3:     file format elf64-x86-64

My version is:
$ eu-readelf --version
readelf (Red Hat elfutils) 0.131

Which makes me wonder why gdb is allowing the load of the symbol file given:

1. There seems to be no build ID
2. The CRC in the library doesn't match the CRC of the library.debug

The rabbit hole gets deeper :-/

-- 
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk


  reply	other threads:[~2009-09-03 13:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03 13:03 Alex Bennee
2009-09-03 13:11 ` Jan Kratochvil
2009-09-03 13:45   ` Alex Bennee [this message]
2009-09-03 14:24     ` Jan Kratochvil
2009-09-03 14:47     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2cdc9f30909030645g465bccfbx977072b16953353c@mail.gmail.com \
    --to=kernel-hacker@bennee.com \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox