This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Relocation question


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]