summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2023-01-18 10:32:14 -0500
committerRich Felker <dalias@aerifal.cx>2023-01-18 10:32:14 -0500
commitf897461d4fe72bb71854a6d0662de83008caccb7 (patch)
tree32a00795b118694b618b9736ee44a9de98775d62 /ldso
parenta4b0a665b84c4a3117cca152fe28c204d23ece46 (diff)
downloadmusl-f897461d4fe72bb71854a6d0662de83008caccb7.tar.gz
fix debugger tracking of shared libraries on mips with PIE main program
mips has its own mechanisms for DT_DEBUG because it makes _DYNAMIC read-only, and the original mechanism, DT_MIPS_RLD_MAP, was PIE-incompatible. DT_MIPS_RLD_MAP_REL was added to remedy this, but we never implemented support for it. add it now using the same idioms for mips-specific ldso logic.
Diffstat (limited to 'ldso')
-rw-r--r--ldso/dynlink.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index 09f3b0a8..fde5f346 100644
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -1992,6 +1992,10 @@ void __dls3(size_t *sp, size_t *auxv)
size_t *ptr = (size_t *) app.dynv[i+1];
*ptr = (size_t)&debug;
}
+ if (app.dynv[i]==DT_DEBUG_INDIRECT_REL) {
+ size_t *ptr = (size_t *)((size_t)&app.dynv[i] + app.dynv[i+1]);
+ *ptr = (size_t)&debug;
+ }
}
/* This must be done before final relocations, since it calls