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-darwin.c | |
parent | 9e468e953cd2f605a3f51d6ef6532e46b8fdd7b4 (diff) | |
download | binutils-549dfc51b07c0c749ebde15a3fa855ab496ea18a.zip binutils-549dfc51b07c0c749ebde15a3fa855ab496ea18a.tar.gz binutils-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-darwin.c')
-rw-r--r-- | gdb/solib-darwin.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index e61ec0d..4eca080 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -33,6 +33,7 @@ #include "solist.h" #include "solib.h" #include "solib-svr4.h" +#include "solib-darwin.h" #include "bfd-target.h" #include "elf-bfd.h" @@ -674,18 +675,15 @@ darwin_bfd_open (const char *pathname) return res; } -struct target_so_ops darwin_so_ops; - -void _initialize_darwin_solib (); -void -_initialize_darwin_solib () +const struct target_so_ops darwin_so_ops = { - darwin_so_ops.relocate_section_addresses = darwin_relocate_section_addresses; - darwin_so_ops.free_so = darwin_free_so; - darwin_so_ops.clear_solib = darwin_clear_solib; - darwin_so_ops.solib_create_inferior_hook = darwin_solib_create_inferior_hook; - darwin_so_ops.current_sos = darwin_current_sos; - darwin_so_ops.open_symbol_file_object = open_symbol_file_object; - darwin_so_ops.in_dynsym_resolve_code = darwin_in_dynsym_resolve_code; - darwin_so_ops.bfd_open = darwin_bfd_open; -} + darwin_relocate_section_addresses, + darwin_free_so, + nullptr, + darwin_clear_solib, + darwin_solib_create_inferior_hook, + darwin_current_sos, + open_symbol_file_object, + darwin_in_dynsym_resolve_code, + darwin_bfd_open, +}; |