From c0154a4a21a3aed01ef53877af05cf0109a0b124 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 16 Aug 2021 16:17:25 -0700 Subject: gdb: Don't assume r_ldsomap when r_version > 1 on Linux The r_ldsomap field is specific to Solaris (part of librtld_db), and should never be accessed for Linux. glibc is planning to add a field to support multiple namespaces. But there will be no r_ldsomap when r_version is bumped to 2. Add linux_[ilp32|lp64]_fetch_link_map_offsets to set r_ldsomap_offset to -1 and use them for Linux targets. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28236 --- gdb/riscv-linux-tdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/riscv-linux-tdep.c') diff --git a/gdb/riscv-linux-tdep.c b/gdb/riscv-linux-tdep.c index 49dc75b..7351e19 100644 --- a/gdb/riscv-linux-tdep.c +++ b/gdb/riscv-linux-tdep.c @@ -187,8 +187,8 @@ riscv_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_solib_svr4_fetch_link_map_offsets (gdbarch, (riscv_isa_xlen (gdbarch) == 4 - ? svr4_ilp32_fetch_link_map_offsets - : svr4_lp64_fetch_link_map_offsets)); + ? linux_ilp32_fetch_link_map_offsets + : linux_lp64_fetch_link_map_offsets)); /* GNU/Linux uses SVR4-style shared libraries. */ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); -- cgit v1.1