diff mbox series

[v4,5/9] elf: Use RTLD_NODELETE for dependencies

Message ID 20241206173850.3766841-6-adhemerval.zanella@linaro.org
State New
Headers show
Series Add support for memory sealing | expand

Commit Message

Adhemerval Zanella Dec. 6, 2024, 5:37 p.m. UTC
So dlopen dependencies for objects opened with RTLD_NODELETE
are also marked with RTLD_NODELETE.

Checked on x86_64-linux-gnu.
---
 elf/dl-open.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/elf/dl-open.c b/elf/dl-open.c
index ba3c266e6a..f283a87144 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -604,7 +604,8 @@  dl_open_worker_begin (void *a)
 
   /* Load that object's dependencies.  */
   _dl_map_object_deps (new, NULL, 0, 0,
-		       mode & (__RTLD_DLOPEN | RTLD_DEEPBIND | __RTLD_AUDIT));
+		       mode & (__RTLD_DLOPEN | RTLD_DEEPBIND | __RTLD_AUDIT
+			       | RTLD_NODELETE));
 
   /* So far, so good.  Now check the versions.  */
   for (unsigned int i = 0; i < new->l_searchlist.r_nlist; ++i)