aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-dsbt.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-08-08 11:00:50 -0600
committerTom Tromey <tromey@adacore.com>2022-09-20 12:25:19 -0600
commit549dfc51b07c0c749ebde15a3fa855ab496ea18a (patch)
tree19524424c91615492c20104d1e6b880e4afa5fc4 /gdb/solib-dsbt.c
parent9e468e953cd2f605a3f51d6ef6532e46b8fdd7b4 (diff)
downloadfsf-binutils-gdb-549dfc51b07c0c749ebde15a3fa855ab496ea18a.zip
fsf-binutils-gdb-549dfc51b07c0c749ebde15a3fa855ab496ea18a.tar.gz
fsf-binutils-gdb-549dfc51b07c0c749ebde15a3fa855ab496ea18a.tar.bz2
Constify some target_so_ops instances
This changes some target_so_ops instances to be const. This makes their use a little more obvious (they can't be mutated) and also allows for the removal of some initialization code.
Diffstat (limited to 'gdb/solib-dsbt.c')
-rw-r--r--gdb/solib-dsbt.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
index b4cd163..b866a0b 100644
--- a/gdb/solib-dsbt.c
+++ b/gdb/solib-dsbt.c
@@ -29,6 +29,7 @@
#include "gdbcmd.h"
#include "elf-bfd.h"
#include "gdb_bfd.h"
+#include "solib-dsbt.h"
#define GOT_MODULE_OFFSET 4
@@ -924,21 +925,23 @@ show_dsbt_debug (struct ui_file *file, int from_tty,
gdb_printf (file, _("solib-dsbt debugging is %s.\n"), value);
}
-struct target_so_ops dsbt_so_ops;
+const struct target_so_ops dsbt_so_ops =
+{
+ dsbt_relocate_section_addresses,
+ dsbt_free_so,
+ nullptr,
+ dsbt_clear_solib,
+ dsbt_solib_create_inferior_hook,
+ dsbt_current_sos,
+ open_symbol_file_object,
+ dsbt_in_dynsym_resolve_code,
+ solib_bfd_open,
+};
void _initialize_dsbt_solib ();
void
_initialize_dsbt_solib ()
{
- dsbt_so_ops.relocate_section_addresses = dsbt_relocate_section_addresses;
- dsbt_so_ops.free_so = dsbt_free_so;
- dsbt_so_ops.clear_solib = dsbt_clear_solib;
- dsbt_so_ops.solib_create_inferior_hook = dsbt_solib_create_inferior_hook;
- dsbt_so_ops.current_sos = dsbt_current_sos;
- dsbt_so_ops.open_symbol_file_object = open_symbol_file_object;
- dsbt_so_ops.in_dynsym_resolve_code = dsbt_in_dynsym_resolve_code;
- dsbt_so_ops.bfd_open = solib_bfd_open;
-
/* Debug this file's internals. */
add_setshow_zuinteger_cmd ("solib-dsbt", class_maintenance,
&solib_dsbt_debug, _("\