From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18808 invoked by alias); 19 Jun 2009 14:56:41 -0000 Received: (qmail 18744 invoked by uid 22791); 19 Jun 2009 14:56:40 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Jun 2009 14:56:33 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 470AF10D6B; Fri, 19 Jun 2009 14:56:26 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id EADF910D65; Fri, 19 Jun 2009 14:56:25 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MHfVw-0003nE-JR; Fri, 19 Jun 2009 10:56:24 -0400 Date: Fri, 19 Jun 2009 14:56:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: aristovski@qnx.com, gdb-patches@sources.redhat.com Subject: Re: [patch] solib-svr4.c - allow reading linkmap info from core without executable Message-ID: <20090619145624.GA14310@caradoc.them.org> Mail-Followup-To: Mark Kettenis , aristovski@qnx.com, gdb-patches@sources.redhat.com References: <200906102308.29638.pedro@codesourcery.com> <4A310906.4030603@qnx.com> <200906190004.23937.pedro@codesourcery.com> <200906191442.n5JEg4QW029005@brahms.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906191442.n5JEg4QW029005@brahms.sibelius.xs4all.nl> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00504.txt.bz2 On Fri, Jun 19, 2009 at 04:42:04PM +0200, Mark Kettenis wrote: > > From: Aleksandar Ristovski > > Date: Fri, 19 Jun 2009 10:16:26 -0400 > > > > Pedro Alves wrote: > > > > > > I was thinking on pushing the elf check a bit down instead, > > > like the below. However, having now tested this, I see that > > > this doesn't work in most of the cores I have here (x86_64-linux). > > > In most cases I see, the segment that would contain the program > > > headers, as indicated by auxv info, isn't included in the > > > core... > > > > > > (objdump -h) > > > Idx Name Size VMA LMA File off Algn > > > : > > > 6 load1 00000000 0000000000400000 0000000000000000 000008f8 2**0 > > > ALLOC, READONLY, CODE > > > : > > > > > I'm somewhat amazed that the Linux kernel doesn't dump the auxv stuff. > Without the auxv data, debugging core dumps of PIE executables will be > impossible. > > Perhaps the kernel does include the information in the does, but bfd > doesn't have the necessary code to turn it into an .auxv section? That works fine: drow@caradoc:~% readelf -n core Notes at offset 0x00000430 with length 0x00000344: Owner Data size Description CORE 0x00000150 NT_PRSTATUS (prstatus structure) CORE 0x00000088 NT_PRPSINFO (prpsinfo structure) CORE 0x00000130 NT_AUXV (auxiliary vector) drow@caradoc:~% objdump -h core core: file format elf64-x86-64 Sections: Idx Name Size VMA LMA File off Algn 0 note0 00000344 0000000000000000 0000000000000000 00000430 2**0 CONTENTS, READONLY 1 .reg/14342 000000d8 0000000000000000 0000000000000000 000004b4 2**2 CONTENTS 2 .reg 000000d8 0000000000000000 0000000000000000 000004b4 2**2 CONTENTS 3 .auxv 00000130 0000000000000000 0000000000000000 00000644 2**3 CONTENTS But reading it again, Pedro said "the segment that would contain the program headers, as indicated by auxv info". That's probably not dumped by default, as it's read-only. -- Daniel Jacobowitz CodeSourcery