public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: "Stefan Burström" <f94sbu@efd.lth.se>
Cc: gdb@sources.redhat.com
Subject: Re: Relocation question
Date: Wed, 10 Aug 2005 21:33:00 -0000	[thread overview]
Message-ID: <jeu0hxpjei.fsf@sykes.suse.de> (raw)
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")

Stefan Burström <f94sbu@efd.lth.se> 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."

  parent reply	other threads:[~2005-08-10 21:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-10 19:00 Stefan Burström
2005-08-10 19:54 ` Simon Richter
2005-08-10 21:33 ` Andreas Schwab [this message]
2005-08-11 13:51 Ton van Overbeek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jeu0hxpjei.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=f94sbu@efd.lth.se \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).