summaryrefslogtreecommitdiff
path: root/gdb/mips-fbsd-tdep.c
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2021-10-04 10:24:35 +0200
committerMarkus Metzger <markus.t.metzger@intel.com>2022-10-18 14:16:08 +0200
commit8d56636a0ecbe6c38bf52b0683326ee21693c548 (patch)
treed31ea425eab963a5849039435427ea2880dba1c2 /gdb/mips-fbsd-tdep.c
parent60d09f0a0d8000359b8f1dd14b51e7f013ea9e5c (diff)
downloadbinutils-gdb-8d56636a0ecbe6c38bf52b0683326ee21693c548.tar.gz
gdb, gdbserver: support dlmopen()
In glibc, the r_debug structure contains (amongst others) the following fields: int r_version: Version number for this protocol. It should be greater than 0. If r_version is 2, struct r_debug is extended to struct r_debug_extended with one additional field: struct r_debug_extended *r_next; Link to the next r_debug_extended structure. Each r_debug_extended structure represents a different namespace. The first r_debug_extended structure is for the default namespace. 1. Change solib_svr4_r_map argument to take the debug base. 2. Add solib_svr4_r_next to find the link map in the next namespace from the r_next field. 3. Update svr4_current_sos_direct to get the link map in the next namespace from the r_next field. 4. Don't check shared libraries in other namespaces when updating shared libraries in a new namespace. 5. Update svr4_same to check the load offset in addition to the name 6. Update svr4_default_sos to also set l_addr_inferior 7. Change the flat solib_list into a per-namespace list using the namespace's r_debug address to identify the namespace. Add gdb.base/dlmopen.exp to test this. To remain backwards compatible with older gdbserver, we reserve the namespace zero for a flat list of solibs from all namespaces. Subsequent patches will extend RSP to allow listing libraries grouped by namespace. This fixes PR 11839. Co-authored-by: Lu, Hongjiu <hongjiu.lu@intel.com>
Diffstat (limited to 'gdb/mips-fbsd-tdep.c')
-rw-r--r--gdb/mips-fbsd-tdep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/mips-fbsd-tdep.c b/gdb/mips-fbsd-tdep.c
index eae53108c03..0de1007d74f 100644
--- a/gdb/mips-fbsd-tdep.c
+++ b/gdb/mips-fbsd-tdep.c
@@ -495,6 +495,7 @@ mips_fbsd_ilp32_fetch_link_map_offsets (void)
lmo.r_map_offset = 4;
lmo.r_brk_offset = 8;
lmo.r_ldsomap_offset = -1;
+ lmo.r_next_offset = -1;
lmo.link_map_size = 24;
lmo.l_addr_offset = 0;
@@ -522,6 +523,7 @@ mips_fbsd_lp64_fetch_link_map_offsets (void)
lmo.r_map_offset = 8;
lmo.r_brk_offset = 16;
lmo.r_ldsomap_offset = -1;
+ lmo.r_next_offset = -1;
lmo.link_map_size = 48;
lmo.l_addr_offset = 0;