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


Hi,

Stefan Burström wrote:

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

w00t! How far are you concerning bfd support for 0x3f3 binaries? I have
just started work on that as I need that to hack a new bootloader for
APUS Linux in order to survive the cleanup going on in the kernel.

> 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)

AFAIK gdb knows of an offset to apply to everything that needs to be set
around loading time, but I don't remember offhand how to do that. I need
such a beast myself, so I'm going to invest some time into that in the
next days (my problem at hand is that bFLT executables also get
relocated, and that it is pretty normal to have a PIC register for the
data section to allow sharing code between processes).

   Simon

Attachment: signature.asc
Description: OpenPGP digital signature


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