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
This commit is contained in:
H.J. Lu
2021-08-16 16:17:25 -07:00
parent 4eb629d50d
commit c0154a4a21
27 changed files with 97 additions and 32 deletions

View File

@@ -732,7 +732,7 @@ arc_linux_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
/* GNU/Linux uses SVR4-style shared libraries, with 32-bit ints, longs
and pointers (ILP32). */
set_solib_svr4_fetch_link_map_offsets (gdbarch,
svr4_ilp32_fetch_link_map_offsets);
linux_ilp32_fetch_link_map_offsets);
}
/* Suppress warning from -Wmissing-prototypes. */