summaryrefslogtreecommitdiffstats
path: root/lib/csu/sparc64/crt1.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-01-07 17:58:27 +0000
committerkib <kib@FreeBSD.org>2013-01-07 17:58:27 +0000
commit6d5842f6eea3f16811bd199c8dd2945772ddb351 (patch)
tree089d450b585552ae260a600f8fb4848dfd8480b9 /lib/csu/sparc64/crt1.c
parentdf2c4939a02300f9c4d66e1a38553e5743cbb5f9 (diff)
downloadFreeBSD-src-6d5842f6eea3f16811bd199c8dd2945772ddb351.zip
FreeBSD-src-6d5842f6eea3f16811bd199c8dd2945772ddb351.tar.gz
Only assign the environ in the startup code when environ is NULL.
Preloaded library could have changed the environment, and unconditional assingment to the environ undoes the customization. The binaries needs to be recompiled to get the fix. Move the common code to set up environ and __progname into the helper. Note that ia64 possibly not fixed, due to it still using old csu. Reported and tested by: John Hein <jhein@symmetricom.com> Reviewed by: kan, scf Approved by: secteam (simon) MFC after: 2 weeks
Diffstat (limited to 'lib/csu/sparc64/crt1.c')
-rw-r--r--lib/csu/sparc64/crt1.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/csu/sparc64/crt1.c b/lib/csu/sparc64/crt1.c
index 3b3ecc2..e11ae39 100644
--- a/lib/csu/sparc64/crt1.c
+++ b/lib/csu/sparc64/crt1.c
@@ -85,9 +85,7 @@ _start(char **ap, void (*cleanup)(void), struct Struct_Obj_Entry *obj __unused,
argc = *(long *)(void *)ap;
argv = ap + 1;
env = ap + 2 + argc;
- environ = env;
- if (argc > 0 && argv[0] != NULL)
- handle_progname(argv[0]);
+ handle_argv(argc, argv, env);
if (&_DYNAMIC != NULL)
atexit(cleanup);
OpenPOWER on IntegriCloud