diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2001-06-09 21:51:59 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2001-06-09 21:51:59 +0000 |
commit | 7505d98a2942b2a8b18c6f32712802c839295c24 (patch) | |
tree | 9629c3685e490296b1d1b55f09c0559be437a7c8 /gnu/usr.bin/ld/rtld | |
parent | 448201cd0199aa461cb7ceb3f3cd0b0da2a20d9d (diff) |
Fill some field earlier, should allow better .init/dlopen interaction.
From NetBSD.
fgsch@ agrees.
Diffstat (limited to 'gnu/usr.bin/ld/rtld')
-rw-r--r-- | gnu/usr.bin/ld/rtld/rtld.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index d40e1511349..aa80b0f308a 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/rtld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld.c,v 1.18 2000/04/27 19:33:09 espie Exp $ */ +/* $OpenBSD: rtld.c,v 1.19 2001/06/09 21:51:58 espie Exp $ */ /* $NetBSD: rtld.c,v 1.43 1996/01/14 00:35:17 pk Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -300,6 +300,12 @@ rtld(version, crtp, dp) LM_PRIVATE(smp)->spd_refcount++; LM_PRIVATE(smp)->spd_flags |= RTLD_RTLD; + /* Fill in some field in main's __DYNAMIC structure */ + if (version >= CRT_VERSION_BSD_4) + crtp->crt_ldentry = &ld_entry; + else + crtp->crt_dp->d_entry = &ld_entry; + /* Handle LD_PRELOAD's here */ ld_preload_path = getenv("LD_PRELOAD"); if (ld_preload_path != NULL) @@ -315,12 +321,6 @@ rtld(version, crtp, dp) init_maps(link_map_head); - /* Fill in some field in main's __DYNAMIC structure */ - if (version >= CRT_VERSION_BSD_4) - crtp->crt_ldentry = &ld_entry; - else - crtp->crt_dp->d_entry = &ld_entry; - crtp->crt_dp->d_un.d_sdt->sdt_loaded = link_map_head->som_next; ddp = crtp->crt_dp->d_debug; |