From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11492 invoked by alias); 2 Mar 2014 18:52:37 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 11472 invoked by uid 9674); 2 Mar 2014 18:52:36 -0000 Date: Sun, 02 Mar 2014 18:52:00 -0000 Message-ID: <20140302185236.11442.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] jankratochvil/gdbserverbuildid: Tests for validate symbol file using build-id X-Git-Refname: refs/heads/jankratochvil/gdbserverbuildid X-Git-Reftype: branch X-Git-Oldrev: 5de3b9620438df4453fb61bbf81c39e234e019c5 X-Git-Newrev: e3b4a3c174a858ca8f19de50512232068c97ed8e X-SW-Source: 2014-q1/txt/msg00016.txt.bz2 List-Id: The branch, jankratochvil/gdbserverbuildid has been updated discards 5de3b9620438df4453fb61bbf81c39e234e019c5 (commit) discards d66b2150ae277d597717f7d00aff9d79361eb871 (commit) via e3b4a3c174a858ca8f19de50512232068c97ed8e (commit) via 0593e434034ee1c8f0520f8f5353b559731125e5 (commit) from 5de3b9620438df4453fb61bbf81c39e234e019c5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit e3b4a3c174a858ca8f19de50512232068c97ed8e Author: Jan Kratochvil Date: Sun Mar 2 10:15:42 2014 +0100 Tests for validate symbol file using build-id gdb/testsuite/ 2014-02-26 Aleksandar Ristovski Date: Sun Mar 2 10:15:42 2014 +0100 Validate symbol file using build-id gdb/ 2014-02-26 Aleksandar Ristovski Validate symbol file using build-id. * NEWS (Changes since GDB 7.7): Add 'set solib-build-id-force' and 'show solib-build-id-force'. Add build-id attribute. * solib-darwin.c (_initialize_darwin_solib): Assign validate value. * solib-dsbt.c (_initialize_dsbt_solib): Ditto. * solib-frv.c (_initialize_frv_solib): Ditto. * solib-ia64-hpux.c (ia64_hpux_target_so_ops): Ditto. * solib-irix.c (_initialize_irix_solib): Ditto. * solib-osf.c (_initialize_osf_solib): Ditto. * solib-pa64.c (_initialize_pa64_solib): Ditto. * solib-som.c (_initialize_som_solib): Ditto. * solib-spu.c (set_spu_solib_ops): Ditto. * solib-svr4.c: Include rsp-low.h. (NOTE_GNU_BUILD_ID_NAME): New define. (svr4_validate): New function. (library_list_start_library): Parse 'build-id' attribute. (svr4_library_attributes): Add 'build-id' attribute. (_initialize_svr4_solib): Assign validate value. * solib-target.c (solib.h): Include. (_initialize_solib_target): Assign validate value. * solib.c (solib_build_id_force, show_solib_build_id_force): New. (solib_map_sections): Use ops->validate. (clear_so): Free build_id. (default_solib_validate): New function. (_initialize_solib): Add "solib-build-id-force". * solib.h (default_solib_validate): New declaration. * solist.h (struct so_list): New fields 'build_idsz' and 'build_id'. (target_so_ops): New field 'validate'. gdb/doc/ 2014-03-02 Jan Kratochvil * gdb.texinfo (Files): Add 'set solib-build-id-force' and 'show solib-build-id-force'. ----------------------------------------------------------------------- Summary of changes: gdb/NEWS | 8 +++++++- gdb/solist.h | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) First 500 lines of diff: diff --git a/gdb/NEWS b/gdb/NEWS index e876be4..629cc13 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -43,6 +43,12 @@ maint ada show ignore-descriptive-types the user manual for more details on descriptive types and the intended usage of this option. +set solib-build-id-force (on|off) +show solib-build-id-force + Inferior shared library and symbol file may contain unique build-id. + If both build-ids are present but they do not match then this setting + enables (on) or disables (off) loading of such symbol file. + * New features in the GDB remote stub, GDBserver ** New option --debug-format=option1[,option2,...] allows one to add @@ -52,7 +58,7 @@ maint ada show ignore-descriptive-types "monitor set debug-format timestamps" command from GDB. ** library-list-svr4 contains also optional attribute 'build-id' for - each library. GDB also does not load library with build-id that + each library. GDB does not load library with build-id that does not match such attribute. * The 'record instruction-history' command now starts counting instructions diff --git a/gdb/solist.h b/gdb/solist.h index 68c88ee..b5fa91a 100644 --- a/gdb/solist.h +++ b/gdb/solist.h @@ -82,7 +82,13 @@ struct so_list packet or via reading target memory. Therefore, it may differ from the build-id of the associated bfd. In a normal scenario, this so would soon lose its abfd due to failed - validation. */ + validation. + Reading target memory should be done by following execution view + of the binary (following program headers in the case of ELF). + Computing address from the linking view (following ELF section + headers) may give incorrect build-id memory address despite the + symbols still match. + Such an example is a prelinked vs. unprelinked i386 ELF file. */ size_t build_idsz; gdb_byte *build_id; }; hooks/post-receive -- Repository for Project Archer.