From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27569 invoked by alias); 5 May 2010 14:35:36 -0000 Received: (qmail 27540 invoked by uid 22791); 5 May 2010 14:35:30 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 May 2010 14:35:22 +0000 Received: (qmail 26860 invoked from network); 5 May 2010 14:35:20 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 May 2010 14:35:20 -0000 Date: Wed, 05 May 2010 14:35:00 -0000 From: Daniel Jacobowitz To: Andrew Stubbs Cc: gdb@sourceware.org Subject: Re: debug problem with prelinked libraries Message-ID: <20100505143213.GA4735@caradoc.them.org> Mail-Followup-To: Andrew Stubbs , gdb@sourceware.org References: <4BE16915.7080501@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BE16915.7080501@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-05/txt/msg00030.txt.bz2 On Wed, May 05, 2010 at 01:48:21PM +0100, Andrew Stubbs wrote: > Hi all, > > I'm trying to get to the bottom of a problem debugging prelinked > libraries. I've fixed a few aspects of the problem, but the further I > get into it the more I think I must be missing something. I mean, > debugging prelinked libraries is supposed to Just Work, right? But I > can't see how it could ever have worked. It definitely works. GDB is even supposed to automatically handle libraries that are prelinked to a different location on disk than they were at runtime, although that's relatively recent, IIRC. > Upon closer inspection, I find that the psymtab has the textlow and > texthigh addresses as the original file-offsets, before relocation. > This appears to be because it calculates the section offset as the > difference between the actual address and the ELF VMA, but the file > is prelinked, so the offset is zero, and the debug info and symbols > are then not relocated. What do you mean by "before relocation"? Are the libraries used to create the core dump prelinked in exactly the same way as the libraries on the host during debug, or not? It should work either way, but they're different cases. If both libraries are identically prelinked, then I would have expected the prelinked libraries to not require relocation. prelink includes code to manipulate the contents of the debug info. I don't know if prelink follows things across to separate debug info files. It doesn't look like it. So if you have that, too, then the separate debug info file should be treated as a not-prelinked copy of the shared library. -- Daniel Jacobowitz CodeSourcery