]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/solib: make solib_ops::in_dynsym_resolve_code optional
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 26 May 2025 20:26:16 +0000 (16:26 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 29 May 2025 14:49:37 +0000 (10:49 -0400)
Two solib ops implementations have dummy implementations for the
in_dynsym_resolve_code callback.  Make it optional, to avoid this.

Change-Id: I786776fb82ce1b96335a97713fbfe8074c84c00c
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
gdb/solib-aix.c
gdb/solib-darwin.c
gdb/solib.c

index 7ff9bf4482e06b594b35c28d5272025112f6684c..4af83de4d3714f512903bda7b46bfda0fae06bc3 100644 (file)
@@ -489,14 +489,6 @@ solib_aix_current_sos ()
   return sos;
 }
 
-/* Implement the "in_dynsym_resolve_code" solib_ops method.  */
-
-static bool
-solib_aix_in_dynsym_resolve_code (CORE_ADDR pc)
-{
-  return false;
-}
-
 /* Implement the "bfd_open" solib_ops method.  */
 
 static gdb_bfd_ref_ptr
@@ -676,7 +668,7 @@ const solib_ops solib_aix_so_ops =
   solib_aix_solib_create_inferior_hook,
   solib_aix_current_sos,
   nullptr,
-  solib_aix_in_dynsym_resolve_code,
+  nullptr,
   solib_aix_bfd_open,
   nullptr,
   nullptr,
index 14db2efd735476ce1a4c2e2fceb4e753a4bd8af4..4003c77748ca22e7cba057842c7a659ad33d4156 100644 (file)
@@ -353,15 +353,6 @@ darwin_read_exec_load_addr_at_init (struct darwin_info *info)
   return darwin_validate_exec_header (load_addr);
 }
 
-/* Return true if PC lies in the dynamic symbol resolution code of the
-   run time loader.  */
-
-static bool
-darwin_in_dynsym_resolve_code (CORE_ADDR pc)
-{
-  return false;
-}
-
 /* A wrapper for bfd_mach_o_fat_extract that handles reference
    counting properly.  This will either return NULL, or return a new
    reference to a BFD.  */
@@ -640,7 +631,7 @@ const solib_ops darwin_so_ops =
   darwin_solib_create_inferior_hook,
   darwin_current_sos,
   nullptr,
-  darwin_in_dynsym_resolve_code,
+  nullptr,
   darwin_bfd_open,
   nullptr,
   nullptr,
index e357803bc76ee33b8ec87551eebe2bfd631271a8..ba12c785d98056bcac883e8a356e534070fd30a4 100644 (file)
@@ -1325,8 +1325,10 @@ solib_create_inferior_hook (int from_tty)
 bool
 in_solib_dynsym_resolve_code (CORE_ADDR pc)
 {
-  return (gdbarch_so_ops (current_inferior ()->arch ())
-         ->in_dynsym_resolve_code (pc));
+  const auto in_dynsym_resolve_code
+    = gdbarch_so_ops (current_inferior ()->arch ())->in_dynsym_resolve_code;
+
+  return in_dynsym_resolve_code && in_dynsym_resolve_code (pc);
 }
 
 /* Implements the "sharedlibrary" command.  */