summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-03-31 21:56:59 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-03-31 21:56:59 +0000
commit52a68c9638016a5fcf55be826ce42b38b6c033e5 (patch)
tree9a33cc8ba2c7e341fbf0ae0c32f1ba8a406dcb57 /libexec/ld.so
parentc52deb8538ed0d022ea1acdf0eea84c8a1ef66c2 (diff)
Do not run static constructors when run from ldd. ok theo, art, espie, pefo
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/loader.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c
index 2a821d8bfdf..66f28e8c7a2 100644
--- a/libexec/ld.so/loader.c
+++ b/libexec/ld.so/loader.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: loader.c,v 1.27 2002/03/17 19:02:30 art Exp $ */
+/* $OpenBSD: loader.c,v 1.28 2002/03/31 21:56:58 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -202,16 +202,18 @@ _dl_boot(const char **argv, const char **envp, const long loff,
* it is responsible for running it's own ctors/dtors
* thus do NOT run the ctors for the executable, all of
* the shared libraries which follow.
+ * Do not run init code if run from ldd.
*/
- if (_dl_objects->next) {
+ if ((_dl_traceld == NULL) && (_dl_objects->next != NULL)) {
_dl_call_init(_dl_objects->next);
}
/*
* Schedule a routine to be run at shutdown, by using atexit.
* cannot call atexit directly from ld.so?
+ * Do not schedule destructors if run from ldd.
*/
- {
+ if (_dl_traceld == NULL) {
const Elf_Sym *sym;
Elf_Addr ooff;