aboutsummaryrefslogtreecommitdiff
path: root/gdb/solist.h
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2015-07-15 17:37:28 +0200
committerJan Kratochvil <jan.kratochvil@redhat.com>2015-07-15 17:42:07 +0200
commitca5268b6be265580b91ef75c1a1a9815f581ae42 (patch)
treebfe99b4ca46a726297c74f34ea68abe95d546ec2 /gdb/solist.h
parent700ca40f6fc1addd7238f4ab57f76c095ad3c99f (diff)
downloadgdb-ca5268b6be265580b91ef75c1a1a9815f581ae42.zip
gdb-ca5268b6be265580b91ef75c1a1a9815f581ae42.tar.gz
gdb-ca5268b6be265580b91ef75c1a1a9815f581ae42.tar.bz2
Validate symbol file using build-id
Consumer part of the "build-id" attribute. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski <aristovski@qnx.com Jan Kratochvil <jan.kratochvil@redhat.com> Validate symbol file using build-id. * NEWS (Changes since GDB 7.10): Add 'set validate-build-id' and 'show validate-build-id'. 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-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. (svr4_copy_library_list): Duplicate field build_id. (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 (validate_build_id, show_validate_build_id): New. (solib_map_sections): Use ops->validate. (clear_so): Free build_id. (default_solib_validate): New function. (_initialize_solib): Add "validate-build-id". * 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/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.texinfo (Files): Add 'set validate-build-id' and 'show validate-build-id'.
Diffstat (limited to 'gdb/solist.h')
-rw-r--r--gdb/solist.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/solist.h b/gdb/solist.h
index 7021f5c..e6e74af 100644
--- a/gdb/solist.h
+++ b/gdb/solist.h
@@ -75,6 +75,19 @@ struct so_list
There may not be just one (e.g. if two segments are relocated
differently); but this is only used for "info sharedlibrary". */
CORE_ADDR addr_low, addr_high;
+
+ /* Build id decoded from .note.gnu.build-id without note header. This is
+ actual BUILD_ID which comes either from the remote target via qXfer
+ packet or via reading target memory. Note that if there's a
+ mismatch with the associated bfd then so->abfd will be cleared.
+ 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;
};
struct target_so_ops
@@ -168,6 +181,11 @@ struct target_so_ops
NULL, in which case no specific preprocessing is necessary
for this target. */
void (*handle_event) (void);
+
+ /* Return NULL if SO does match target SO it is supposed to
+ represent. Otherwise return string describing why it does not match.
+ Caller has to free the string. */
+ char *(*validate) (const struct so_list *so);
};
/* Free the memory associated with a (so_list *). */