diff options
| author | wdenk <wdenk> | 2004-04-12 16:12:49 +0000 | 
|---|---|---|
| committer | wdenk <wdenk> | 2004-04-12 16:12:49 +0000 | 
| commit | d716b126718d874f52ffb694e6c22b7235cec483 (patch) | |
| tree | 621a24955203ad5c221a3049fee60048e74b556e | |
| parent | 56b86bf0cd6ce45d337154c133ab361120ee5569 (diff) | |
| download | olio-uboot-2014.01-d716b126718d874f52ffb694e6c22b7235cec483.tar.xz olio-uboot-2014.01-d716b126718d874f52ffb694e6c22b7235cec483.zip | |
Add startup code to clear the BSS of standalone applications
| -rw-r--r-- | CHANGELOG | 2 | ||||
| -rw-r--r-- | examples/mips.lds | 3 | ||||
| -rw-r--r-- | examples/nios.lds | 1 | ||||
| -rw-r--r-- | examples/stubs.c | 9 | 
4 files changed, 15 insertions, 0 deletions
| @@ -2,6 +2,8 @@  Changes for U-Boot 1.1.1:  ====================================================================== +* add startup code to clear the BSS of standalone applications +  * Fix if / elif handling bug in HUSH shell  ====================================================================== diff --git a/examples/mips.lds b/examples/mips.lds index 8ed01c445..9d9849bf5 100644 --- a/examples/mips.lds +++ b/examples/mips.lds @@ -51,6 +51,9 @@ SECTIONS  	.sdata  : { *(.sdata) }  	. = ALIGN(4); +	__bss_start = .;  	.sbss  : { *(.sbss) }  	.bss  : { *(.bss) } + +	_end = .;  } diff --git a/examples/nios.lds b/examples/nios.lds index 527eb3ad4..dd5bfad7b 100644 --- a/examples/nios.lds +++ b/examples/nios.lds @@ -57,4 +57,5 @@ SECTIONS  	}  	. = ALIGN(4);  	__bss_end = .; +	_end = .;  } diff --git a/examples/stubs.c b/examples/stubs.c index a26337a92..a897d0d21 100644 --- a/examples/stubs.c +++ b/examples/stubs.c @@ -110,8 +110,17 @@ static void __attribute__((unused)) dummy(void)  #include <_exports.h>  } +extern unsigned long __bss_start, _end; +  void app_startup(char **argv)  { +	unsigned long * cp = &__bss_start; + +	/* Zero out BSS */ +	while (cp < &_end) { +		*cp++ = 0; +	} +  #if defined(CONFIG_I386)  	/* x86 does not have a dedicated register for passing global_data */  	global_data = (gd_t *)argv[-1]; |