Skip to content
Snippets Groups Projects
Commit d716b126 authored by Wolfgang Denk's avatar Wolfgang Denk
Browse files

Add startup code to clear the BSS of standalone applications

parent 56b86bf0
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
Changes for U-Boot 1.1.1: 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 * Fix if / elif handling bug in HUSH shell
====================================================================== ======================================================================
......
...@@ -51,6 +51,9 @@ SECTIONS ...@@ -51,6 +51,9 @@ SECTIONS
.sdata : { *(.sdata) } .sdata : { *(.sdata) }
. = ALIGN(4); . = ALIGN(4);
__bss_start = .;
.sbss : { *(.sbss) } .sbss : { *(.sbss) }
.bss : { *(.bss) } .bss : { *(.bss) }
_end = .;
} }
...@@ -57,4 +57,5 @@ SECTIONS ...@@ -57,4 +57,5 @@ SECTIONS
} }
. = ALIGN(4); . = ALIGN(4);
__bss_end = .; __bss_end = .;
_end = .;
} }
...@@ -110,8 +110,17 @@ static void __attribute__((unused)) dummy(void) ...@@ -110,8 +110,17 @@ static void __attribute__((unused)) dummy(void)
#include <_exports.h> #include <_exports.h>
} }
extern unsigned long __bss_start, _end;
void app_startup(char **argv) void app_startup(char **argv)
{ {
unsigned long * cp = &__bss_start;
/* Zero out BSS */
while (cp < &_end) {
*cp++ = 0;
}
#if defined(CONFIG_I386) #if defined(CONFIG_I386)
/* x86 does not have a dedicated register for passing global_data */ /* x86 does not have a dedicated register for passing global_data */
global_data = (gd_t *)argv[-1]; global_data = (gd_t *)argv[-1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment