This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patchv3 7/8] Validate symbol file using build-id
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Aleksandar Ristovski <ARistovski at qnx dot com>
- Date: Fri, 28 Feb 2014 21:20:09 +0100
- Subject: Re: [patchv3 7/8] Validate symbol file using build-id
- Authentication-results: sourceware.org; auth=none
- References: <20140227213334 dot GH21121 at host2 dot jankratochvil dot net> <53108EF7 dot 3000708 at redhat dot com>
On Fri, 28 Feb 2014 14:28:23 +0100, Pedro Alves wrote:
> On 02/27/2014 09:33 PM, Jan Kratochvil wrote:
> > +static int
> > +svr4_validate (const struct so_list *const so)
> > +{
> > + gdb_assert (so != NULL);
> > +
> > + /* There is no way to safely fetch build-id from running inferior without OS
>
> What is "safely" referring to here?
The bug that was there from Aleksandar and my former wrong approval in the
review. The mail [patch 0/8] contains larger removed code which was trying to
read build-id data from address computed from the on-disk BFD (symbol) file.
But that does not work for i386 files prelinked on disk and unprelinked in
memory (or vice versa) as on this arch REL<->RELA conversion changes VMAs.
Code/data symbols still match then but the build-id VMA does not, therefore
GDB would read build-id from wrong address (=read a garbage).
gdbserver does it correctly as it reads ELF header, Program headers, PT_NOTE
etc. from the memory, not from disk.
> > + specific code. The code from get_hex_build_id from gdbserver/linux-low.c
> > + could be used for GNU/Linux NAT target. */
>
> I'd rather not have comments that kind of suggest solib-svr4.c
> is a Linux-specific file, when it is not.
>
> I'd prefer just saying:
>
> + /* Target doesn't support reporting the build ID. */
Put it there. But it is a useless text not describing the IMO unclear VMA
change described above.
Jan