fixed loader script stack setup

This commit is contained in:
Blaise Tine
2020-12-31 22:37:20 -05:00
parent e757a0e333
commit e4a00dd0d9
43 changed files with 157370 additions and 118082 deletions

View File

@@ -9,7 +9,6 @@ OUTPUT_ARCH(riscv)
ENTRY(_start)
SECTIONS
{
PROVIDE(__stack_top = 0x6ffff000);
. = 0x80000000;
.interp : { *(.interp) }
.note.gnu.build-id : { *(.note.gnu.build-id) }
@@ -191,10 +190,24 @@ SECTIONS
. = SEGMENT_START("ldata-segment", .);
. = ALIGN(32 / 8);
__BSS_END__ = .;
__global_pointer$ = MIN(__SDATA_BEGIN__ + 0x800,
__global_pointer = MIN(__SDATA_BEGIN__ + 0x800,
MAX(__DATA_BEGIN__ + 0x800, __BSS_END__ - 0x800));
_end = .; PROVIDE (end = .);
. = DATA_SEGMENT_END (.);
. = DATA_SEGMENT_END (.);
/* .stack_dummy section doesn't contains any symbols. It is only
* used for linker to calculate size of stack sections, and assign
* values to stack symbols later */
.stack_dummy (COPY):
{
KEEP(*(.stack*))
}
__stack_usage = SIZEOF(.stack_dummy);
PROVIDE(__stack_top = 0xFF000000);
PROVIDE(__stack_size = 0x400);
PROVIDE(__stack = __stack_top);
ASSERT(__stack_usage <= __stack_size, "stack overflow")
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }