From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14059 invoked by alias); 10 Aug 2005 19:54:58 -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 14028 invoked by uid 22791); 10 Aug 2005 19:54:53 -0000 Received: from kleinhenz.com (HELO kleinhenz.com) (213.239.205.196) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 10 Aug 2005 19:54:53 +0000 Received: from [192.168.115.35] (p54993094.dip.t-dialin.net [84.153.48.148]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Simon Richter", Issuer "Kleinhenz Elektronik CA" (verified OK)) by kleinhenz.com (Postfix) with ESMTP id 288004A800C; Wed, 10 Aug 2005 21:54:41 +0200 (CEST) Message-ID: <42FA5B78.6000207@hogyros.de> Date: Wed, 10 Aug 2005 19:54:00 -0000 From: Simon Richter User-Agent: Debian Thunderbird 1.0.2 (X11/20050402) MIME-Version: 1.0 To: =?ISO-8859-15?Q?Stefan_Burstr=F6m?= Cc: gdb@sources.redhat.com Subject: Re: Relocation question References: <33ee1ab42d6.485e60cd@mail.m.bonet.se> In-Reply-To: <33ee1ab42d6.485e60cd@mail.m.bonet.se> OpenPGP: url=http://www.hogyros.de/simon.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig4212ADC431588F09E24CC846" X-SW-Source: 2005-08/txt/msg00046.txt.bz2 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig4212ADC431588F09E24CC846 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Content-length: 1077 Hi, Stefan Burstr=F6m wrote: > 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. w00t! How far are you concerning bfd support for 0x3f3 binaries? I have just started work on that as I need that to hack a new bootloader for APUS Linux in order to survive the cleanup going on in the kernel. > 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) AFAIK gdb knows of an offset to apply to everything that needs to be set around loading time, but I don't remember offhand how to do that. I need such a beast myself, so I'm going to invest some time into that in the next days (my problem at hand is that bFLT executables also get relocated, and that it is pretty normal to have a PIC register for the data section to allow sharing code between processes). Simon --------------enig4212ADC431588F09E24CC846 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 307 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iQCVAwUBQvpbelYr4CN7gCINAQLpAQP/dJwOGUvstKbDqIF2qep+LN6cQIxvCfuu 0+x+wa2T+/WfT9EI2R11mD3D2Dvh8TgKZxh6/CTzNEyg94qFirmTMhlSMmdOredx UBbtQ+oNtPVKGxi2Bn6lQme4ZDxpuzFfRpo6AiiFH0Ynx8G5IyDENFlYG/U0MVIH 2Yyl8W9IstM= =EoZe -----END PGP SIGNATURE----- --------------enig4212ADC431588F09E24CC846--