public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Stefan Burström" <f94sbu@efd.lth.se>
To: gdb@sources.redhat.com
Subject: Relocation question

Date: Wed, 10 Aug 2005 19:00:00 -0000	[thread overview]
Message-ID: <33ee1ab42d6.485e60cd@mail.m.bonet.se> (raw)

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öm

             reply	other threads:[~2005-08-10 19:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-10 19:00 Stefan Burström [this message]
2005-08-10 19:54 ` Simon Richter
2005-08-10 21:33 ` Andreas Schwab
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=33ee1ab42d6.485e60cd@mail.m.bonet.se \
    --to=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).