]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/solib: make implementation of solib_ops::open_symbol_file_object optional
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 26 May 2025 20:26:15 +0000 (16:26 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 29 May 2025 14:49:37 +0000 (10:49 -0400)
The only solib implementation that implements open_symbol_file_object is
SVR4.  All others just return 0.  Make it optional, to avoid having
these empty functions.

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

index 4eb89e9341b9ee09df5d1eb979b3eab725b4256c..7ff9bf4482e06b594b35c28d5272025112f6684c 100644 (file)
@@ -489,14 +489,6 @@ solib_aix_current_sos ()
   return sos;
 }
 
-/* Implement the "open_symbol_file_object" solib_ops method.  */
-
-static int
-solib_aix_open_symbol_file_object (int from_tty)
-{
-  return 0;
-}
-
 /* Implement the "in_dynsym_resolve_code" solib_ops method.  */
 
 static bool
@@ -683,7 +675,7 @@ const solib_ops solib_aix_so_ops =
   nullptr,
   solib_aix_solib_create_inferior_hook,
   solib_aix_current_sos,
-  solib_aix_open_symbol_file_object,
+  nullptr,
   solib_aix_in_dynsym_resolve_code,
   solib_aix_bfd_open,
   nullptr,
index 86a71bb228091384d9b2f356b5f343959c1afcb7..14db2efd735476ce1a4c2e2fceb4e753a4bd8af4 100644 (file)
@@ -188,16 +188,6 @@ find_program_interpreter (void)
   return buf;
 }
 
-/*  Not used.  I don't see how the main symbol file can be found: the
-    interpreter name is needed and it is known from the executable file.
-    Note that darwin-nat.c implements pid_to_exec_file.  */
-
-static int
-open_symbol_file_object (int from_tty)
-{
-  return 0;
-}
-
 /* Build a list of currently loaded shared objects.  See solib-svr4.c.  */
 
 static owning_intrusive_list<solib>
@@ -649,7 +639,7 @@ const solib_ops darwin_so_ops =
   darwin_clear_solib,
   darwin_solib_create_inferior_hook,
   darwin_current_sos,
-  open_symbol_file_object,
+  nullptr,
   darwin_in_dynsym_resolve_code,
   darwin_bfd_open,
   nullptr,
index ed6580eca0fadda9954ccda278ca9879b5e2d4e4..2b3153692805f74bb6a28b42c8b36bd630dc0934 100644 (file)
@@ -392,15 +392,6 @@ fetch_loadmap (CORE_ADDR ldmaddr)
 static void dsbt_relocate_main_executable (void);
 static int enable_break (void);
 
-/* See solib.h. */
-
-static int
-open_symbol_file_object (int from_tty)
-{
-  /* Unimplemented.  */
-  return 0;
-}
-
 /* Given a loadmap and an address, return the displacement needed
    to relocate the address.  */
 
@@ -909,7 +900,7 @@ const solib_ops dsbt_so_ops =
   dsbt_clear_solib,
   dsbt_solib_create_inferior_hook,
   dsbt_current_sos,
-  open_symbol_file_object,
+  nullptr,
   dsbt_in_dynsym_resolve_code,
   solib_bfd_open,
   nullptr,
index 0ccbf90330973f72d0470a0a23cd9e17127fc75b..ceef72208a1bc05ce7ce4bf95108b822f7d00d58 100644 (file)
@@ -236,15 +236,6 @@ static void frv_relocate_main_executable (void);
 static CORE_ADDR main_got (void);
 static int enable_break2 (void);
 
-/* Implement the "open_symbol_file_object" solib_ops method.  */
-
-static int
-open_symbol_file_object (int from_tty)
-{
-  /* Unimplemented.  */
-  return 0;
-}
-
 /* Cached value for lm_base(), below.  */
 static CORE_ADDR lm_base_cache = 0;
 
@@ -1080,7 +1071,7 @@ const solib_ops frv_so_ops =
   frv_clear_solib,
   frv_solib_create_inferior_hook,
   frv_current_sos,
-  open_symbol_file_object,
+  nullptr,
   frv_in_dynsym_resolve_code,
   solib_bfd_open,
   nullptr,
index 7ccb87daa9564e323d3cf697f5fab5ed17478ec6..c20a843449bdcbd3e1ee00c5abd0476a54deb3f9 100644 (file)
@@ -382,14 +382,6 @@ Could not relocate shared library \"%s\": bad offsets"), so.name.c_str ());
   sec->endaddr += offset;
 }
 
-static int
-solib_target_open_symbol_file_object (int from_tty)
-{
-  /* We can't locate the main symbol file based on the target's
-     knowledge; the user has to specify it.  */
-  return 0;
-}
-
 static bool
 solib_target_in_dynsym_resolve_code (CORE_ADDR pc)
 {
@@ -406,7 +398,7 @@ const solib_ops solib_target_so_ops =
   nullptr,
   solib_target_solib_create_inferior_hook,
   solib_target_current_sos,
-  solib_target_open_symbol_file_object,
+  nullptr,
   solib_target_in_dynsym_resolve_code,
   solib_bfd_open,
   nullptr,
index 8a997a40c22f5491577aec2f4497bfa13fe0d996..e357803bc76ee33b8ec87551eebe2bfd631271a8 100644 (file)
@@ -723,7 +723,8 @@ update_solib_list (int from_tty)
         have not opened a symbol file, we may be able to get its
         symbols now!  */
       if (inf->attach_flag
-         && current_program_space->symfile_object_file == NULL)
+         && current_program_space->symfile_object_file == nullptr
+         && ops->open_symbol_file_object != nullptr)
        {
          try
            {