diff options
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/dynlink.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ldso/dynlink.c b/ldso/dynlink.c index f497542e..87f3b7f8 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1582,11 +1582,14 @@ _Noreturn void __dls3(size_t *sp) load_deps(&app); make_global(&app); -#ifndef DYNAMIC_IS_RO - for (i=0; app.dynv[i]; i+=2) - if (app.dynv[i]==DT_DEBUG) + for (i=0; app.dynv[i]; i+=2) { + if (!DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG) app.dynv[i+1] = (size_t)&debug; -#endif + if (DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG_INDIRECT) { + size_t *ptr = (size_t *) app.dynv[i+1]; + *ptr = (size_t)&debug; + } + } /* The main program must be relocated LAST since it may contin * copy relocations which depend on libraries' relocations. */ |