This is the mail archive of the
mailing list for the GDB project.
Re: question about why gdb needs executable's binary
Aha, perfect, now it makes sense, thank you very much for your patience :)
Den tir. 19. mar. 2019 kl. 15:41 skrev Jan Kratochvil <
> On Tue, 19 Mar 2019 16:25:30 +0100, Jirka Koutný wrote:
> > I see, just to make sure - DT_DEBUG gets dumped into the corefile, is
> > correct?
> The PT_DYNAMIC segment containing the DT_DEBUG pointer (pointing to
> r_debug/_r_debug) normally gets dumped into the core file. The problem is
> without having the main executable one cannot much find where is the
> pointer located in the core file. Core file has for example NT_AUXV where
> AT_PHDR and from program headers one could find PT_DYNAMIC where is
> But core file does not have to contain the program headers as those may be
> a read-only page of the main executable. Nowadays with dumping of the first
> page of any ELF (even if it is read-only, for its NT_GNU_BUILD_ID) one can
> probably find the program headers there. But then one can also just read
> NT_FILE nowadays.