From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9399 invoked by alias); 3 Sep 2009 13:45:50 -0000 Received: (qmail 9373 invoked by uid 22791); 3 Sep 2009 13:45:48 -0000 X-SWARE-Spam-Status: No, hits=1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_75,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-ew0-f216.google.com (HELO mail-ew0-f216.google.com) (209.85.219.216) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Sep 2009 13:45:37 +0000 Received: by ewy12 with SMTP id 12so1783566ewy.0 for ; Thu, 03 Sep 2009 06:45:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.8.65 with SMTP id 43mr520715weq.168.1251985532915; Thu, 03 Sep 2009 06:45:32 -0700 (PDT) In-Reply-To: <20090903131100.GA27450@host0.dyn.jankratochvil.net> References: <20090903131100.GA27450@host0.dyn.jankratochvil.net> Date: Thu, 03 Sep 2009 13:45:00 -0000 Message-ID: Subject: Re: Manually checking build id in elf files From: Alex Bennee To: Jan Kratochvil Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00040.txt.bz2 2009/9/3 Jan Kratochvil : > 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: > =A0Owner =A0 =A0 =A0 =A0 =A0Data size =A0Type > =A0GNU =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 20 =A0GNU_BUILD_ID > =A0 =A0Build ID: ec8dd400904ddfcac8b1c343263a790f977159dc > [...] > > # eu-unstrip -n -e /lib64/libc.so.6 > 0x3979600000+0x36d868 ec8dd400904ddfcac8b1c343263a790f977159dc@0x39796002= 80 /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 :-/ --=20 Alex, homepage: http://www.bennee.com/~alex/ http://www.half-llama.co.uk