diff mbox series

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

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

Commit Message

Adhemerval Zanella Netto Sept. 30, 2024, 8:08 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 8b4704c09d..f251781dc4 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -600,7 +600,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)