From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24414 invoked by alias); 3 Sep 2009 13:11:15 -0000 Received: (qmail 24402 invoked by uid 22791); 3 Sep 2009 13:11:14 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Sep 2009 13:11:06 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n83DB3sV028252 for ; Thu, 3 Sep 2009 09:11:04 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n83DB1AH013213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 3 Sep 2009 09:11:03 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n83DB0QL027902; Thu, 3 Sep 2009 15:11:01 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n83DB0kQ027897; Thu, 3 Sep 2009 15:11:00 +0200 Date: Thu, 03 Sep 2009 13:11:00 -0000 From: Jan Kratochvil To: Alex Bennee Cc: gdb@sourceware.org Subject: Re: Manually checking build id in elf files Message-ID: <20090903131100.GA27450@host0.dyn.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) 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/msg00038.txt.bz2 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