CORE_ADDR frv_fetch_objfile_link_map (struct objfile *objfile);
struct target_so_ops;
-extern struct target_so_ops frv_so_ops;
+extern const struct target_so_ops frv_so_ops;
#endif /* FRV_TDEP_H */
}
/* The target_so_ops for AIX targets. */
-struct target_so_ops solib_aix_so_ops;
+const struct target_so_ops solib_aix_so_ops =
+{
+ solib_aix_relocate_section_addresses,
+ solib_aix_free_so,
+ nullptr,
+ solib_aix_clear_solib,
+ solib_aix_solib_create_inferior_hook,
+ solib_aix_current_sos,
+ solib_aix_open_symbol_file_object,
+ solib_aix_in_dynsym_resolve_code,
+ solib_aix_bfd_open,
+};
void _initialize_solib_aix ();
void
_initialize_solib_aix ()
{
- solib_aix_so_ops.relocate_section_addresses
- = solib_aix_relocate_section_addresses;
- solib_aix_so_ops.free_so = solib_aix_free_so;
- solib_aix_so_ops.clear_solib = solib_aix_clear_solib;
- solib_aix_so_ops.solib_create_inferior_hook
- = solib_aix_solib_create_inferior_hook;
- solib_aix_so_ops.current_sos = solib_aix_current_sos;
- solib_aix_so_ops.open_symbol_file_object
- = solib_aix_open_symbol_file_object;
- solib_aix_so_ops.in_dynsym_resolve_code
- = solib_aix_in_dynsym_resolve_code;
- solib_aix_so_ops.bfd_open = solib_aix_bfd_open;
-
gdb::observers::normal_stop.attach (solib_aix_normal_stop_observer,
"solib-aix");
#define SOLIB_AIX_H
struct target_so_ops;
-extern struct target_so_ops solib_aix_so_ops;
+extern const struct target_so_ops solib_aix_so_ops;
extern CORE_ADDR solib_aix_get_toc_value (CORE_ADDR pc);
#include "solist.h"
#include "solib.h"
#include "solib-svr4.h"
+#include "solib-darwin.h"
#include "bfd-target.h"
#include "elf-bfd.h"
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,
+};
struct objfile;
struct target_so_ops;
-extern struct target_so_ops darwin_so_ops;
+extern const struct target_so_ops darwin_so_ops;
#endif /* solib-darwin.h */
#include "gdbcmd.h"
#include "elf-bfd.h"
#include "gdb_bfd.h"
+#include "solib-dsbt.h"
#define GOT_MODULE_OFFSET 4
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, _("\
--- /dev/null
+/* Handle shared libraries for GDB, the GNU Debugger.
+
+ Copyright (C) 2022 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef SOLIB_DSBT_H
+#define SOLIB_DSBT_H
+
+struct objfile;
+struct target_so_ops;
+
+extern const struct target_so_ops dsbt_so_ops;
+
+#endif /* solib-dsbt.h */
return 0;
}
-struct target_so_ops frv_so_ops;
+const struct target_so_ops frv_so_ops =
+{
+ frv_relocate_section_addresses,
+ frv_free_so,
+ nullptr,
+ frv_clear_solib,
+ frv_solib_create_inferior_hook,
+ frv_current_sos,
+ open_symbol_file_object,
+ frv_in_dynsym_resolve_code,
+ solib_bfd_open,
+};
void _initialize_frv_solib ();
void
_initialize_frv_solib ()
{
- frv_so_ops.relocate_section_addresses = frv_relocate_section_addresses;
- frv_so_ops.free_so = frv_free_so;
- frv_so_ops.clear_solib = frv_clear_solib;
- frv_so_ops.solib_create_inferior_hook = frv_solib_create_inferior_hook;
- frv_so_ops.current_sos = frv_current_sos;
- frv_so_ops.open_symbol_file_object = open_symbol_file_object;
- frv_so_ops.in_dynsym_resolve_code = frv_in_dynsym_resolve_code;
- frv_so_ops.bfd_open = solib_bfd_open;
-
/* Debug this file's internals. */
add_setshow_zuinteger_cmd ("solib-frv", class_maintenance,
&solib_frv_debug, _("\
}
\f
-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. */
}
}
+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");
}
struct objfile;
struct target_so_ops;
-extern struct target_so_ops svr4_so_ops;
+extern const struct target_so_ops svr4_so_ops;
/* Link map info to include in an allocated so_list entry. */
return in_plt_section (pc);
}
-struct target_so_ops solib_target_so_ops;
-
-void _initialize_solib_target ();
-void
-_initialize_solib_target ()
+const struct target_so_ops solib_target_so_ops =
{
- solib_target_so_ops.relocate_section_addresses
- = solib_target_relocate_section_addresses;
- solib_target_so_ops.free_so = solib_target_free_so;
- solib_target_so_ops.clear_solib = solib_target_clear_solib;
- solib_target_so_ops.solib_create_inferior_hook
- = solib_target_solib_create_inferior_hook;
- solib_target_so_ops.current_sos = solib_target_current_sos;
- solib_target_so_ops.open_symbol_file_object
- = solib_target_open_symbol_file_object;
- solib_target_so_ops.in_dynsym_resolve_code
- = solib_target_in_dynsym_resolve_code;
- solib_target_so_ops.bfd_open = solib_bfd_open;
-}
+ solib_target_relocate_section_addresses,
+ solib_target_free_so,
+ nullptr,
+ solib_target_clear_solib,
+ solib_target_solib_create_inferior_hook,
+ solib_target_current_sos,
+ solib_target_open_symbol_file_object,
+ solib_target_in_dynsym_resolve_code,
+ solib_bfd_open,
+};
#define SOLIB_TARGET_H
struct target_so_ops;
-extern struct target_so_ops solib_target_so_ops;
+extern const struct target_so_ops solib_target_so_ops;
#endif /* solib-target.h */
#include "elf-bfd.h"
#include "elf/tic6x.h"
#include "gdbarch.h"
+#include "solib-dsbt.h"
/* The offset from rt_sigframe pointer to SP register. */
#define TIC6X_SP_RT_SIGFRAME 8
}
-extern struct target_so_ops dsbt_so_ops;
static void
tic6x_uclinux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{