+
+/* Implementation of `sym_get_probes', as documented in symfile.h. */
+
+static VEC (probe_p) *
+elf_get_probes (struct objfile *objfile)
+{
+ VEC (probe_p) *probes_per_objfile;
+
+ /* Have we parsed this objfile's probes already? */
+ probes_per_objfile = objfile_data (objfile, probe_key);
+
+ if (!probes_per_objfile)
+ {
+ int ix;
+ const struct probe_ops *probe_ops;
+
+ /* Here we try to gather information about all types of probes from the
+ objfile. */
+ for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, probe_ops);
+ ix++)
+ probe_ops->get_probes (&probes_per_objfile, objfile);
+
+ if (probes_per_objfile == NULL)
+ {
+ VEC_reserve (probe_p, probes_per_objfile, 1);
+ gdb_assert (probes_per_objfile != NULL);
+ }
+
+ set_objfile_data (objfile, probe_key, probes_per_objfile);
+ }
+
+ return probes_per_objfile;
+}
+
+/* Implementation of `sym_get_probe_argument_count', as documented in
+ symfile.h. */
+
+static unsigned
+elf_get_probe_argument_count (struct probe *probe)
+{
+ return probe->pops->get_probe_argument_count (probe);
+}
+
+/* Implementation of `sym_evaluate_probe_argument', as documented in
+ symfile.h. */
+
+static struct value *
+elf_evaluate_probe_argument (struct probe *probe, unsigned n)
+{
+ return probe->pops->evaluate_probe_argument (probe, n);
+}
+
+/* Implementation of `sym_compile_to_ax', as documented in symfile.h. */
+
+static void
+elf_compile_to_ax (struct probe *probe,
+ struct agent_expr *expr,
+ struct axs_value *value,
+ unsigned n)
+{
+ probe->pops->compile_to_ax (probe, expr, value, n);
+}
+
+/* Implementation of `sym_relocate_probe', as documented in symfile.h. */
+
+static void
+elf_symfile_relocate_probe (struct objfile *objfile,
+ struct section_offsets *new_offsets,
+ struct section_offsets *delta)
+{
+ int ix;
+ VEC (probe_p) *probes = objfile_data (objfile, probe_key);
+ struct probe *probe;
+
+ for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++)
+ probe->pops->relocate (probe, ANOFFSET (delta, SECT_OFF_TEXT (objfile)));
+}
+
+/* Helper function used to free the space allocated for storing SystemTap
+ probe information. */
+
+static void
+probe_key_free (struct objfile *objfile, void *d)
+{
+ int ix;
+ VEC (probe_p) *probes = d;
+ struct probe *probe;
+
+ for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++)
+ probe->pops->destroy (probe);
+
+ VEC_free (probe_p, probes);
+}
+