From: Simon Marchi Date: Thu, 5 Jun 2025 19:18:43 +0000 (-0400) Subject: gdb/solib-svr4: remove svr4_have_link_map_offsets X-Git-Tag: binutils-2_45~359 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c42a6946cdb683340df92a77b1e0321ecb8e09a;p=thirdparty%2Fbinutils-gdb.git gdb/solib-svr4: remove svr4_have_link_map_offsets 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 --- diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index b7af602c333..48aace1feb4 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -48,7 +48,6 @@ #include 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); -} - - /* 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. */