This is the mail archive of the gdb-patches@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: [patchv3 7/8] Validate symbol file using build-id


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


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