From be83844e4cf998dc60411c6802635caf7e8d94e7 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 10 Sep 2002 00:46:45 +0000 Subject: 2002-09-09 Jeff Johnston * libc/sys/linux/machine/i386/crt0.c (_start): Remove code that clears the .bss section. --- newlib/libc/sys/linux/machine/i386/crt0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'newlib/libc/sys/linux/machine') diff --git a/newlib/libc/sys/linux/machine/i386/crt0.c b/newlib/libc/sys/linux/machine/i386/crt0.c index 84ea0435b..4364f61d4 100644 --- a/newlib/libc/sys/linux/machine/i386/crt0.c +++ b/newlib/libc/sys/linux/machine/i386/crt0.c @@ -33,8 +33,12 @@ void _start(int args) environ = argv+argc+1; - /* clear bss */ - memset(&__bss_start,0,(&_end - &__bss_start)); + /* Note: do not clear the .bss section. When running with shared + * libraries, certain data items such __mb_cur_max or environ + * may get placed in the .bss, even though they are initialized + * to non-zero values. Clearing the .bss will end up zeroing + * out their initial values. The .bss is already initialized + * by this time by Linux. */ tzset(); /* initialize timezone info */ exit(main(argc,argv,environ)); -- cgit v1.2.3