From: Tom Tromey Date: Fri, 9 Jan 2026 19:19:11 +0000 (-0700) Subject: Remove the sofun_address_maybe_missing gdbarch setting X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52bfc2b45b052deca6c0ff09a5e6dfabc5cde362;p=thirdparty%2Fbinutils-gdb.git Remove the sofun_address_maybe_missing gdbarch setting The gdbarch setting sofun_address_maybe_missing was stabs-specific and so can be removed. --- diff --git a/gdb/gdbarch-gen.c b/gdb/gdbarch-gen.c index 73e0b84c6dc..573f6eefc96 100644 --- a/gdb/gdbarch-gen.c +++ b/gdb/gdbarch-gen.c @@ -196,7 +196,6 @@ struct gdbarch gdbarch_relocate_instruction_ftype *relocate_instruction = nullptr; gdbarch_overlay_update_ftype *overlay_update = nullptr; gdbarch_core_read_description_ftype *core_read_description = nullptr; - int sofun_address_maybe_missing = 0; gdbarch_process_record_ftype *process_record = nullptr; gdbarch_process_record_signal_ftype *process_record_signal = nullptr; gdbarch_gdb_signal_from_target_ftype *gdb_signal_from_target = nullptr; @@ -461,7 +460,6 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of relocate_instruction, invalid_p == 0. */ /* Skip verify of overlay_update, has predicate. */ /* Skip verify of core_read_description, has predicate. */ - /* Skip verify of sofun_address_maybe_missing, invalid_p == 0. */ /* Skip verify of process_record, has predicate. */ /* Skip verify of process_record_signal, has predicate. */ /* Skip verify of gdb_signal_from_target, has predicate. */ @@ -1120,9 +1118,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdb_printf (file, "gdbarch_dump: core_read_description = <%s>\n", host_address_to_string (gdbarch->core_read_description)); - gdb_printf (file, - "gdbarch_dump: sofun_address_maybe_missing = %s\n", - plongest (gdbarch->sofun_address_maybe_missing)); gdb_printf (file, "gdbarch_dump: gdbarch_process_record_p() = %d\n", gdbarch_process_record_p (gdbarch)); @@ -4203,23 +4198,6 @@ set_gdbarch_core_read_description (struct gdbarch *gdbarch, gdbarch->core_read_description = core_read_description; } -int -gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - /* Skip verify of sofun_address_maybe_missing, invalid_p == 0. */ - if (gdbarch_debug >= 2) - gdb_printf (gdb_stdlog, "gdbarch_sofun_address_maybe_missing called\n"); - return gdbarch->sofun_address_maybe_missing; -} - -void -set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch, - int sofun_address_maybe_missing) -{ - gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing; -} - bool gdbarch_process_record_p (struct gdbarch *gdbarch) { diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h index 7b3396c4f81..1ff02b1067c 100644 --- a/gdb/gdbarch-gen.h +++ b/gdb/gdbarch-gen.h @@ -1210,11 +1210,6 @@ typedef const struct target_desc * (gdbarch_core_read_description_ftype) (struct extern const struct target_desc * gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd); extern void set_gdbarch_core_read_description (struct gdbarch *gdbarch, gdbarch_core_read_description_ftype *core_read_description); -/* Set if the address in N_SO or N_FUN stabs may be zero. */ - -extern int gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch); -extern void set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch, int sofun_address_maybe_missing); - /* Parse the instruction at ADDR storing in the record execution log the registers REGCACHE and memory ranges that will be affected when the instruction executes, along with their current values. diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py index e0fd82c3002..6e765e93155 100644 --- a/gdb/gdbarch_components.py +++ b/gdb/gdbarch_components.py @@ -1987,16 +1987,6 @@ Method( predicate=True, ) -Value( - comment=""" -Set if the address in N_SO or N_FUN stabs may be zero. -""", - type="int", - name="sofun_address_maybe_missing", - predefault="0", - invalid=False, -) - Method( comment=""" Parse the instruction at ADDR storing in the record execution log diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 7a2a1867f98..b122e5fac83 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -1627,10 +1627,6 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->i386_sysenter_record = i386_linux_intx80_sysenter_syscall_record; tdep->i386_syscall_record = i386_linux_intx80_sysenter_syscall_record; - /* N_FUN symbols in shared libraries have 0 for their values and need - to be relocated. */ - set_gdbarch_sofun_address_maybe_missing (gdbarch, 1); - /* GNU/Linux uses SVR4-style shared libraries. */ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); set_solib_svr4_ops (gdbarch, make_linux_ilp32_svr4_solib_ops); diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 9c3b5e99bcc..1dd8e708009 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -8408,10 +8408,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_program_breakpoint_here_p (gdbarch, rs6000_program_breakpoint_here_p); - /* The value of symbols of type N_SO and N_FUN maybe null when - it shouldn't be. */ - set_gdbarch_sofun_address_maybe_missing (gdbarch, 1); - /* Handles single stepping of atomic sequences. */ set_gdbarch_get_next_pcs (gdbarch, ppc_deal_with_atomic_sequence); diff --git a/gdb/sol2-tdep.c b/gdb/sol2-tdep.c index 535ae3eea22..8545ae60da4 100644 --- a/gdb/sol2-tdep.c +++ b/gdb/sol2-tdep.c @@ -102,11 +102,6 @@ sol2_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid) void sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { - /* The Sun compilers (Sun ONE Studio, Forte Developer, Sun WorkShop, SunPRO) - compiler puts out 0 instead of the address in N_SO stabs. Starting with - SunPRO 3.0, the compiler does this for N_FUN stabs too. */ - set_gdbarch_sofun_address_maybe_missing (gdbarch, 1); - /* Solaris uses SVR4-style shared libraries. */ set_gdbarch_skip_solib_resolver (gdbarch, sol2_skip_solib_resolver);