diff options
author | Tom Tromey <tromey@adacore.com> | 2022-08-08 11:00:50 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-09-20 12:25:19 -0600 |
commit | 549dfc51b07c0c749ebde15a3fa855ab496ea18a (patch) | |
tree | 19524424c91615492c20104d1e6b880e4afa5fc4 /gdb/solib-svr4.c | |
parent | 9e468e953cd2f605a3f51d6ef6532e46b8fdd7b4 (diff) | |
download | gdb-549dfc51b07c0c749ebde15a3fa855ab496ea18a.zip gdb-549dfc51b07c0c749ebde15a3fa855ab496ea18a.tar.gz 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-svr4.c')
-rw-r--r-- | gdb/solib-svr4.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 893da86..bab76e2 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -3121,8 +3121,6 @@ svr4_lp64_fetch_link_map_offsets (void) } -struct target_so_ops svr4_so_ops; - /* Search order for ELF DSOs linked with -Bsymbolic. Those DSOs have a different rule for symbol lookup. The lookup begins here in the DSO, not in the main executable. */ @@ -3163,24 +3161,28 @@ svr4_iterate_over_objfiles_in_search_order } } +const struct target_so_ops svr4_so_ops = +{ + svr4_relocate_section_addresses, + svr4_free_so, + svr4_clear_so, + svr4_clear_solib, + svr4_solib_create_inferior_hook, + svr4_current_sos, + open_symbol_file_object, + svr4_in_dynsym_resolve_code, + solib_bfd_open, + nullptr, + svr4_same, + svr4_keep_data_in_core, + svr4_update_solib_event_breakpoints, + svr4_handle_solib_event, +}; + void _initialize_svr4_solib (); void _initialize_svr4_solib () { - svr4_so_ops.relocate_section_addresses = svr4_relocate_section_addresses; - svr4_so_ops.free_so = svr4_free_so; - svr4_so_ops.clear_so = svr4_clear_so; - svr4_so_ops.clear_solib = svr4_clear_solib; - svr4_so_ops.solib_create_inferior_hook = svr4_solib_create_inferior_hook; - svr4_so_ops.current_sos = svr4_current_sos; - svr4_so_ops.open_symbol_file_object = open_symbol_file_object; - svr4_so_ops.in_dynsym_resolve_code = svr4_in_dynsym_resolve_code; - svr4_so_ops.bfd_open = solib_bfd_open; - svr4_so_ops.same = svr4_same; - svr4_so_ops.keep_data_in_core = svr4_keep_data_in_core; - svr4_so_ops.update_breakpoints = svr4_update_solib_event_breakpoints; - svr4_so_ops.handle_event = svr4_handle_solib_event; - gdb::observers::free_objfile.attach (svr4_free_objfile_observer, "solib-svr4"); } |