From 32ff1cb2a58ebdcefd1d517b1ae60137ae5946f6 Mon Sep 17 00:00:00 2001 From: GNU Libc Maintainers Date: Sat, 26 Aug 2017 10:09:24 +0100 Subject: [PATCH] submitted-dlopen-noload 2016-03-12 Aurelien Jarno [BZ #19810] * elf/dl-open.c (dl_open_worker): Set DF_1_NODELETE flag later. Gbp-Pq: Topic any Gbp-Pq: Name submitted-dlopen-noload.diff --- elf/dl-open.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/elf/dl-open.c b/elf/dl-open.c index 55ed8159e..67154e804 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -237,12 +237,6 @@ dl_open_worker (void *a) args->map = new = _dl_map_object (call_map, file, lt_loaded, 0, mode | __RTLD_CALLMAP, args->nsid); - /* Mark the object as not deletable if the RTLD_NODELETE flags was passed. - Do this early so that we don't skip marking the object if it was - already loaded. */ - if (__glibc_unlikely (mode & RTLD_NODELETE)) - new->l_flags_1 |= DF_1_NODELETE; - /* If the pointer returned is NULL this means the RTLD_NOLOAD flag is set and the object is not already loaded. */ if (new == NULL) @@ -251,6 +245,12 @@ dl_open_worker (void *a) return; } + /* Mark the object as not deletable if the RTLD_NODELETE flags was passed. + Do this early so that we don't skip marking the object if it was + already loaded. */ + if (__glibc_unlikely (mode & RTLD_NODELETE)) + new->l_flags_1 |= DF_1_NODELETE; + if (__glibc_unlikely (mode & __RTLD_SPROF)) /* This happens only if we load a DSO for 'sprof'. */ return; -- 2.30.2