This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH RFA] solib-svr4.c patch for dynamic executables
Ulrich Drepper <drepper@redhat.com> writes:
>
> Jim Blandy <jimb@cygnus.com> writes:
>
> > We should look at the ABI to see what rules `exec' follows to decide
> > whether to relocate the main executable, and then make GDB use the
> > same rules.
>
> The rule is: binaries with e_type == ET_DYN have no fixed load address.
> Don't know how to get this out of gdb data structures.
The test is in SysV-specific code anyway, so I think it's fine to look
in the BFD's ELF-specific structures.
If I'm debugging a process created by applying `exec' to a binary
whose e_type == ET_DYN, how can I find the base address the kernel
chose?
To be clear: I'm using the ABI's definition of the term "base address":
The difference between the virtual address of any segment in
memory and the corresponding virtual address in the file is thus a
single constant value for any one executable or shared object in a
a given process. [Except on AIX...] This difference is the `base
address'.