summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/solib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index d889673dab..25adf586a0 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -64,7 +64,13 @@ static const registry<gdbarch>::key<const struct target_so_ops,
static const struct target_so_ops *
solib_ops (struct gdbarch *gdbarch)
{
- return solib_data.get (gdbarch);
+ const struct target_so_ops *result = solib_data.get (gdbarch);
+ if (result == nullptr)
+ {
+ result = current_target_so_ops;
+ set_solib_ops (gdbarch, current_target_so_ops);
+ }
+ return result;
}
/* Set the solib operations for GDBARCH to NEW_OPS. */