mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-24 23:53:04 +00:00
startup: clear bss section
iBoot does this for us, but this is for the benefit of chainload.py and other dump loaders that may not. Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
b673db78c3
commit
dc2b7b3bb4
2 changed files with 6 additions and 0 deletions
2
m1n1.ld
2
m1n1.ld
|
@ -159,11 +159,13 @@ SECTIONS {
|
|||
_file_end = .;
|
||||
} :data
|
||||
.bss : ALIGN(0x4000) {
|
||||
_bss_start = .;
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(.dynbss)
|
||||
*(COMMON)
|
||||
. = ALIGN(0x4000);
|
||||
_bss_end = .;
|
||||
PROVIDE(_stack_top = .);
|
||||
. += _stack_size;
|
||||
PROVIDE(_stack_bot = .);
|
||||
|
|
|
@ -20,6 +20,9 @@ struct rela_entry {
|
|||
void debug_putc(char c);
|
||||
void m1n1_main(void);
|
||||
|
||||
extern char _bss_start[0];
|
||||
extern char _bss_end[0];
|
||||
|
||||
#define R_AARCH64_RELATIVE 1027
|
||||
|
||||
void apply_rela(uint64_t base, struct rela_entry *rela_start, struct rela_entry *rela_end)
|
||||
|
@ -67,6 +70,7 @@ void dump_boot_args(struct boot_args *ba)
|
|||
void _start_c(void *boot_args, void *base)
|
||||
{
|
||||
UNUSED(base);
|
||||
memset64(_bss_start, 0, _bss_end - _bss_start);
|
||||
uart_putchar('s');
|
||||
uart_init();
|
||||
uart_putchar('c');
|
||||
|
|
Loading…
Reference in a new issue