Add startup code to clear the BSS of standalone applications

This commit is contained in:
wdenk 2004-04-12 16:12:49 +00:00
parent 56b86bf0cd
commit d716b12671
4 changed files with 15 additions and 0 deletions

View File

@ -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
======================================================================

View File

@ -51,6 +51,9 @@ SECTIONS
.sdata : { *(.sdata) }
. = ALIGN(4);
__bss_start = .;
.sbss : { *(.sbss) }
.bss : { *(.bss) }
_end = .;
}

View File

@ -57,4 +57,5 @@ SECTIONS
}
. = ALIGN(4);
__bss_end = .;
_end = .;
}

View File

@ -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];