summaryrefslogtreecommitdiff
path: root/lib/csu
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2019-05-08 20:27:30 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2019-05-08 20:27:30 +0000
commit2f8d5325922ef302f55f8846befa07ced56f47cb (patch)
tree2dc5d1c4aa1d22501bb4a47d2553f8d1fa748566 /lib/csu
parent56bade00d783e5a00c5be046e2b2debc39c56f15 (diff)
Call _csu_finish() before {pre,}init_array functions so that in static
executables the TIB and __progname are set up before they can be used. problem noted by ori@ ok millert@ kettenis@
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/crt0.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/csu/crt0.c b/lib/csu/crt0.c
index 7e380626797..ac2966b5490 100644
--- a/lib/csu/crt0.c
+++ b/lib/csu/crt0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crt0.c,v 1.12 2019/01/09 16:42:38 visa Exp $ */
+/* $OpenBSD: crt0.c,v 1.13 2019/05/08 20:27:29 guenther Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou
@@ -81,6 +81,8 @@ ___start(MD_START_ARGS)
MD_START_SETUP
#endif
+ environp = _csu_finish(argv, envp, cleanup);
+
#ifndef RCRT0
if (cleanup == NULL) {
#endif
@@ -95,8 +97,6 @@ ___start(MD_START_ARGS)
}
#endif
- environp = _csu_finish(argv, envp, cleanup);
-
#ifdef MCRT0
atexit(_mcleanup);
_monstartup((u_long)&_eprol, (u_long)&_etext);