diff options
author | kib <kib@FreeBSD.org> | 2013-01-07 17:58:27 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-01-07 17:58:27 +0000 |
commit | 6d5842f6eea3f16811bd199c8dd2945772ddb351 (patch) | |
tree | 089d450b585552ae260a600f8fb4848dfd8480b9 /lib/csu/arm/crt1.c | |
parent | df2c4939a02300f9c4d66e1a38553e5743cbb5f9 (diff) | |
download | FreeBSD-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/arm/crt1.c')
-rw-r--r-- | lib/csu/arm/crt1.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/csu/arm/crt1.c b/lib/csu/arm/crt1.c index 127c28d..e3529b8 100644 --- a/lib/csu/arm/crt1.c +++ b/lib/csu/arm/crt1.c @@ -98,10 +98,7 @@ __start(int argc, char **argv, char **env, struct ps_strings *ps_strings, const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void)) { - environ = env; - - if (argc > 0 && argv[0] != NULL) - handle_progname(argv[0]); + handle_argv(argc, argv, env); if (ps_strings != (struct ps_strings *)0) __ps_strings = ps_strings; |