Skip to content

Commit d5ef1fc

Browse files
committed
gdb/solib: make solib_ops::in_dynsym_resolve_code optional
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 <[email protected]>
1 parent 134767d commit d5ef1fc

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

gdb/solib-aix.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -489,14 +489,6 @@ solib_aix_current_sos ()
489489
return sos;
490490
}
491491

492-
/* Implement the "in_dynsym_resolve_code" solib_ops method. */
493-
494-
static bool
495-
solib_aix_in_dynsym_resolve_code (CORE_ADDR pc)
496-
{
497-
return false;
498-
}
499-
500492
/* Implement the "bfd_open" solib_ops method. */
501493

502494
static gdb_bfd_ref_ptr
@@ -676,7 +668,7 @@ const solib_ops solib_aix_so_ops =
676668
solib_aix_solib_create_inferior_hook,
677669
solib_aix_current_sos,
678670
nullptr,
679-
solib_aix_in_dynsym_resolve_code,
671+
nullptr,
680672
solib_aix_bfd_open,
681673
nullptr,
682674
nullptr,

gdb/solib-darwin.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -353,15 +353,6 @@ darwin_read_exec_load_addr_at_init (struct darwin_info *info)
353353
return darwin_validate_exec_header (load_addr);
354354
}
355355

356-
/* Return true if PC lies in the dynamic symbol resolution code of the
357-
run time loader. */
358-
359-
static bool
360-
darwin_in_dynsym_resolve_code (CORE_ADDR pc)
361-
{
362-
return false;
363-
}
364-
365356
/* A wrapper for bfd_mach_o_fat_extract that handles reference
366357
counting properly. This will either return NULL, or return a new
367358
reference to a BFD. */
@@ -640,7 +631,7 @@ const solib_ops darwin_so_ops =
640631
darwin_solib_create_inferior_hook,
641632
darwin_current_sos,
642633
nullptr,
643-
darwin_in_dynsym_resolve_code,
634+
nullptr,
644635
darwin_bfd_open,
645636
nullptr,
646637
nullptr,

gdb/solib.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,8 +1325,10 @@ solib_create_inferior_hook (int from_tty)
13251325
bool
13261326
in_solib_dynsym_resolve_code (CORE_ADDR pc)
13271327
{
1328-
return (gdbarch_so_ops (current_inferior ()->arch ())
1329-
->in_dynsym_resolve_code (pc));
1328+
const auto in_dynsym_resolve_code
1329+
= gdbarch_so_ops (current_inferior ()->arch ())->in_dynsym_resolve_code;
1330+
1331+
return in_dynsym_resolve_code && in_dynsym_resolve_code (pc);
13301332
}
13311333

13321334
/* Implements the "sharedlibrary" command. */

0 commit comments

Comments
 (0)