public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/release/2.36/master] elf: Do not run constructors for proxy objects
@ 2023-09-11 8:04 Florian Weimer
0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2023-09-11 8:04 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f33ffef08983621c6a89a12771486c3beaf50d11
commit f33ffef08983621c6a89a12771486c3beaf50d11
Author: Florian Weimer <fweimer@redhat.com>
Date: Tue Aug 22 13:56:25 2023 +0200
elf: Do not run constructors for proxy objects
Otherwise, the ld.so constructor runs for each audit namespace
and each dlmopen namespace.
(cherry picked from commit f6c8204fd7fabf0cf4162eaf10ccf23258e4d10e)
Diff:
---
elf/dl-init.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/elf/dl-init.c b/elf/dl-init.c
index deefeb099a..fca8e3a05e 100644
--- a/elf/dl-init.c
+++ b/elf/dl-init.c
@@ -25,10 +25,14 @@
static void
call_init (struct link_map *l, int argc, char **argv, char **env)
{
+ /* Do not run constructors for proxy objects. */
+ if (l != l->l_real)
+ return;
+
/* If the object has not been relocated, this is a bug. The
function pointers are invalid in this case. (Executables do not
- need relocation, and neither do proxy objects.) */
- assert (l->l_real->l_relocated || l->l_real->l_type == lt_executable);
+ need relocation.) */
+ assert (l->l_relocated || l->l_type == lt_executable);
if (l->l_init_called)
/* This object is all done. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-09-11 8:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-11 8:04 [glibc/release/2.36/master] elf: Do not run constructors for proxy objects Florian Weimer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).