This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] validate binary before use
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Aleksandar Ristovski <aristovski at qnx dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 25 Dec 2012 08:37:09 +0100
- Subject: Re: [patch] validate binary before use
- References: <50D4C49A.6040502@qnx.com> <50D8B37A.20001@qnx.com>
On Mon, 24 Dec 2012 20:56:42 +0100, Aleksandar Ristovski wrote:
> While writing a testcase I realized the patch as posted did not work
> in general cases. Comparing whole elf header and whole pheader is
> not an option as they change depending on whether the binary is
> stripped and such.
The checked fields like vaddr also do not match as the local file is commonly
nightly prelinked, unprelinked (after nightly update before prelink has run)
or nightly re-prelinked (see prelink(8)).
Such prelink-aware verification is already implemented in solib-svr4.c in
svr4_exec_displacement. GDB also handles correctly local symbol file in
a different prelink state than the debugged target.
But still I find this verification less reliable and more complicated than the
build-id verification I suggested.
Thanks,
Jan