This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Relocation question
- From: Andreas Schwab <schwab at suse dot de>
- To: Stefan Burström <f94sbu at efd dot lth dot se>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 10 Aug 2005 23:32:53 +0200
- Subject: Re: Relocation question
- References: <33ee1ab42d6.485e60cd@mail.m.bonet.se>
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."