From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17129 invoked by alias); 10 Aug 2005 19:00:21 -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 17110 invoked by uid 22791); 10 Aug 2005 19:00:15 -0000 Received: from mxfep02.bredband.com (HELO mxfep02.bredband.com) (195.54.107.73) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 10 Aug 2005 19:00:15 +0000 Received: from efd.lth.se ([217.215.11.93] [217.215.11.93]) by mxfep02.bredband.com with SMTP id <20050810190013.EOFD17509.mxfep02.bredband.com@efd.lth.se> for ; Wed, 10 Aug 2005 21:00:13 +0200 From: Stefan =?ISO-8859-15?Q?Burstr=F6m?= To: gdb@sources.redhat.com Date: Wed, 10 Aug 2005 19:00:00 -0000 Message-ID: <33ee1ab42d6.485e60cd@mail.m.bonet.se> Subject: Relocation =?ISO-8859-15?Q?question=0A?= MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2005-08/txt/msg00045.txt.bz2 Hello! 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) So, in order for gdb to build the symbol tables etc. it needs to use the relocated addresses instead of the ones retreived directly from the file. What is the prefered way of doing this? I tried to set up the section offsets (real address - address from the bfd code) in the section offsets field, but I am not quite sure exactly when I can set up this table. I tried to set it up in the default_symfile_offsets function and that results in the small symbol table to be correct. However, the addr and endaddr ptrs in the objfile/osections are already set up at this point and will then contain addresses near 0 instead. Which means that every search for an address vill fail since it wont fall between addr and endaddr of the sections loaded from the bfd file. Is this possible to solive in a nice way? regards, Stefan Burstr=F6m