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: [patch] validate binary before use


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


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