]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/solib-svr4: remove svr4_have_link_map_offsets
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 5 Jun 2025 19:18:43 +0000 (15:18 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 9 Jun 2025 19:36:38 +0000 (15:36 -0400)
While C++ifying the solib code, I concluded that all arches that use
SVR4 libraries do provide link map offsets, so I think this function is
unnecessary now.

Change-Id: Ifaae2560d92f658df3724def6219e2f89054e4b7
Approved-By: Tom Tromey <tom@tromey.com>
gdb/solib-svr4.c

index b7af602c33370113c13db8b6a544c6b3445f3b02..48aace1feb480c2751f05ac2beec2dacc7736d30 100644 (file)
@@ -48,7 +48,6 @@
 #include <map>
 
 static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
-static int svr4_have_link_map_offsets (void);
 static void svr4_relocate_main_executable (void);
 static void probes_table_remove_objfile_probes (struct objfile *objfile);
 static void svr4_iterate_over_objfiles_in_search_order
@@ -753,9 +752,6 @@ elf_locate_base (void)
 {
   CORE_ADDR dyn_ptr, dyn_ptr_addr;
 
-  if (!svr4_have_link_map_offsets ())
-    return 0;
-
   /* Look for DT_MIPS_RLD_MAP first.  MIPS executables use this
      instead of DT_DEBUG, although they sometimes contain an unused
      DT_DEBUG.  */
@@ -3327,9 +3323,6 @@ svr4_solib_create_inferior_hook (int from_tty)
   if (!target_has_execution ())
     return;
 
-  if (!svr4_have_link_map_offsets ())
-    return;
-
   if (!enable_break (info, from_tty))
     return;
 }
@@ -3528,17 +3521,6 @@ svr4_fetch_link_map_offsets (void)
   return ops->fetch_link_map_offsets ();
 }
 
-/* Return 1 if a link map offset fetcher has been defined, 0 otherwise.  */
-
-static int
-svr4_have_link_map_offsets (void)
-{
-  struct solib_svr4_ops *ops = get_ops (current_inferior ()->arch ());
-
-  return (ops->fetch_link_map_offsets != NULL);
-}
-\f
-
 /* Most OS'es that have SVR4-style ELF dynamic libraries define a
    `struct r_debug' and a `struct link_map' that are binary compatible
    with the original SVR4 implementation.  */