From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2647 invoked by alias); 10 Aug 2005 21:33:01 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 2628 invoked by uid 22791); 10 Aug 2005 21:32:57 -0000 Received: from mail.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 10 Aug 2005 21:32:57 +0000 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id A0A61EF7D; Wed, 10 Aug 2005 23:32:53 +0200 (CEST) Received: from sykes.suse.de (sykes.suse.de [10.10.3.53]) by Relay1.suse.de (Postfix) with ESMTP id 8AB4D17C92; Wed, 10 Aug 2005 23:32:53 +0200 (CEST) From: Andreas Schwab To: Stefan =?iso-8859-1?Q?Burstr=F6m?= Cc: gdb@sources.redhat.com Subject: Re: Relocation question References: <33ee1ab42d6.485e60cd@mail.m.bonet.se> X-Yow: While my BRAINPAN is being refused service in BURGER KING, Jesuit priests are DATING CAREER DIPLOMATS!! Date: Wed, 10 Aug 2005 21:33:00 -0000 In-Reply-To: <33ee1ab42d6.485e60cd@mail.m.bonet.se> (Stefan =?iso-8859-1?Q?Burstr=F6m's?= message of "Wed, 10 Aug 2005 19:47:14 +0100") Message-ID: User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2005-08/txt/msg00048.txt.bz2 Stefan Burström writes: > Can someone explain to me how gdb is supposed to handle relocated > executables? I am porting gdb to AmigaOS4 which relocates its executables > when they are loaded. However, when I run an application through gdb, gdb > uses the bfd functions to build its map over the file. However, the bfd > library always relocates everything relative to 0 (since it obviously > doesn't know anything else to relocate it to) That reminds me of an old port of gdb 3.6 for the AtariST (which has the same problem). It used CREATE_INFERIOR_HOOK (now called TARGET_CREATE_INFERIOR_HOOK) to query the load address of the just started process and then patched the gdb symtabs and breakpoint addresses by the load offset. But I don't think that would still work nowadays. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."