forked from M-Labs/zynq-rs
1
0
Fork 0

improve linker script

This commit is contained in:
Astro 2019-05-31 00:17:53 +02:00
parent 2df74cc055
commit 2f27ff574f
1 changed files with 9 additions and 13 deletions

22
link.x
View File

@ -1,6 +1,8 @@
ENTRY(_boot_cores); ENTRY(_boot_cores);
STACK_SIZE = 0x2000 - 0x10; STACK_SIZE = 0x2000 - 8;
/* Provide some defaults */
PROVIDE(Reset = _boot_cores); PROVIDE(Reset = _boot_cores);
PROVIDE(UndefinedInstruction = Reset); PROVIDE(UndefinedInstruction = Reset);
PROVIDE(SoftwareInterrupt = Reset); PROVIDE(SoftwareInterrupt = Reset);
@ -18,40 +20,34 @@ MEMORY
SECTIONS SECTIONS
{ {
.exceptions : .exceptions (0x0) :
{ {
. = 0x0;
KEEP(*(.text.exceptions)); KEEP(*(.text.exceptions));
} > OCM } > OCM
.text : .text (0x8000) :
{ {
. = 0x8000;
KEEP(*(.text.boot)) KEEP(*(.text.boot))
*(.text .text.*) *(.text .text.*)
. = ALIGN(4096); /* align to page size */
} > OCM } > OCM
.rodata : .rodata ALIGN(0x1000) :
{ {
*(.rodata) *(.rodata)
. = ALIGN(4096); /* align to page size */
} > OCM } > OCM
.data : .data ALIGN(0x1000) :
{ {
*(.data) *(.data)
. = ALIGN(4096); /* align to page size */
} > OCM } > OCM
.bss (NOLOAD) : .bss ALIGN(0x1000) (NOLOAD) :
{ {
*(.bss) *(.bss)
. = ALIGN(4096); /* align to page size */
} > OCM } > OCM
__bss_start = ADDR(.bss); __bss_start = ADDR(.bss);
__bss_end = ADDR(.bss) + SIZEOF(.bss); __bss_end = ADDR(.bss) + SIZEOF(.bss);
.stack (NOLOAD) : { .stack ALIGN(0x1000) (NOLOAD) : {
. += STACK_SIZE; . += STACK_SIZE;
} > OCM } > OCM
__stack_end = ADDR(.stack); __stack_end = ADDR(.stack);