-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config/linker: add sam3u family linkers
Signed-off-by: perigoso <[email protected]>
- Loading branch information
Showing
4 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
ENTRY(_reset_isr) | ||
|
||
_min_heap_size = 0x800; | ||
_min_stack_size = 0x400; | ||
|
||
/* Initial stack pointer (must be 8 byte aligned) */ | ||
_estack = (ORIGIN(ram) + LENGTH(ram)) & ~7; | ||
|
||
/* Internal device memory */ | ||
PROVIDE(_system_unique_id = 0x1FFFF7E8); | ||
PROVIDE(_system_memory = 0x1FFFF000); | ||
|
||
SECTIONS | ||
{ | ||
/* ISR Vectors */ | ||
.isr_vector : | ||
{ | ||
. = ALIGN(4); | ||
_svect = .; | ||
|
||
KEEP(*(.isr_vector)) | ||
|
||
. = ALIGN(4); | ||
_evect = .; | ||
} > rom | ||
|
||
/* Flash Code */ | ||
.text : | ||
{ | ||
. = ALIGN(4); | ||
_stext = .; | ||
|
||
*(.text) /* .text sections (code) */ | ||
*(.text*) /* .text* sections (code) */ | ||
*(.rodata) /* .rodata sections (constants, strings, etc.) */ | ||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */ | ||
*(.glue_7) /* glue arm to thumb code */ | ||
*(.glue_7t) /* glue thumb to arm code */ | ||
|
||
KEEP(*(.init)) | ||
KEEP(*(.fini)) | ||
|
||
. = ALIGN(4); | ||
_etext = .; | ||
} > rom | ||
|
||
/* ARM */ | ||
.ARM.extab : | ||
{ | ||
*(.ARM.extab* .gnu.linkonce.armextab.*) | ||
} > rom | ||
.ARM : | ||
{ | ||
__exidx_start = .; | ||
|
||
*(.ARM.exidx*) | ||
|
||
__exidx_end = .; | ||
} > rom | ||
.ARM.attributes : | ||
{ | ||
*(.ARM.attributes) | ||
} > rom | ||
|
||
/* C Array init/fini */ | ||
.preinit_array : | ||
{ | ||
PROVIDE_HIDDEN(__preinit_array_start = .); | ||
KEEP(*(.preinit_array*)) | ||
PROVIDE_HIDDEN(__preinit_array_end = .); | ||
} > rom | ||
.init_array : | ||
{ | ||
PROVIDE_HIDDEN(__init_array_start = .); | ||
KEEP(*(SORT(.init_array.*))) | ||
KEEP(*(.init_array*)) | ||
PROVIDE_HIDDEN(__init_array_end = .); | ||
} > rom | ||
.fini_array : | ||
{ | ||
PROVIDE_HIDDEN(__fini_array_start = .); | ||
KEEP(*(.fini_array*)) | ||
KEEP(*(SORT(.fini_array.*))) | ||
PROVIDE_HIDDEN(__fini_array_end = .); | ||
} > rom | ||
|
||
/* RAM Data */ | ||
_sidata = LOADADDR(.data); | ||
|
||
.data : | ||
{ | ||
. = ALIGN(4); | ||
_sdata = .; /* create a global symbol at data start */ | ||
|
||
*(.data) /* .data sections */ | ||
*(.data*) /* .data* sections */ | ||
|
||
. = ALIGN(4); | ||
_edata = .; /* define a global symbol at data end */ | ||
} > ram AT > rom | ||
|
||
/* BSS */ | ||
.bss : | ||
{ | ||
. = ALIGN(4); | ||
_sbss = .; /* define a global symbol at bss start */ | ||
__bss_start__ = _sbss; | ||
|
||
*(.bss) | ||
*(.bss*) | ||
*(COMMON) | ||
|
||
. = ALIGN(4); | ||
_ebss = .; /* define a global symbol at bss end */ | ||
__bss_end__ = _ebss; | ||
} > ram | ||
|
||
PROVIDE(end = _ebss); | ||
PROVIDE(_end = _ebss); | ||
|
||
/* Ensure minimum stack & heap */ | ||
.min_heap_stack : | ||
{ | ||
. = ALIGN(4); | ||
|
||
. = . + _min_heap_size; | ||
. = . + _min_stack_size; | ||
|
||
. = ALIGN(4); | ||
} > ram | ||
|
||
/* Remove unused code from libs */ | ||
/DISCARD/ : | ||
{ | ||
libc.a(*) | ||
libm.a(*) | ||
libgcc.a(*) | ||
libnosys.a(*) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MEMORY | ||
{ | ||
rom (rx) : ORIGIN = 0x00080000, LENGTH = 0x00010000 | ||
ram (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000 | ||
} | ||
|
||
INCLUDE sam3u/common.ld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MEMORY | ||
{ | ||
rom (rx) : ORIGIN = 0x00080000, LENGTH = 0x00020000 | ||
ram (rw) : ORIGIN = 0x20000000, LENGTH = 0x00008000 | ||
} | ||
|
||
INCLUDE sam3u/common.ld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MEMORY | ||
{ | ||
rom (rx) : ORIGIN = 0x00080000, LENGTH = 0x00040000 | ||
ram (rw) : ORIGIN = 0x20000000, LENGTH = 0x0000C000 | ||
} | ||
|
||
INCLUDE sam3u/common.ld |