Skip to content

Commit d83d608

Browse files
committed
Revert back to mainline linker script
1 parent 741254c commit d83d608

File tree

1 file changed

+26
-45
lines changed
  • targets/TARGET_Atmel/TARGET_SAM_CortexM0P/TARGET_SAML21J18A/device/TOOLCHAIN_GCC_ARM

1 file changed

+26
-45
lines changed

targets/TARGET_Atmel/TARGET_SAM_CortexM0P/TARGET_SAML21J18A/device/TOOLCHAIN_GCC_ARM/saml21j18a.ld

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,23 @@ SEARCH_DIR(.)
88

99
STACK_SIZE = MBED_BOOT_STACK_SIZE;
1010

11-
#define ROM_START 0x00000000
12-
#define ROM_SIZE 0x00040000
13-
#define RAM_START 0x20000000
14-
#define RAM_SIZE 0x00008000
15-
#define VECTORS 45 /* This value must match NVIC_NUM_VECTORS */
16-
17-
#define VECTORS_SIZE (VECTORS * 4)
18-
1911
/* Memory Spaces Definitions */
2012
MEMORY {
21-
rom (rx) : ORIGIN = ROM_START, LENGTH = ROM_SIZE
22-
ram (rwx) : ORIGIN = RAM_START + VECTORS_SIZE, LENGTH = RAM_SIZE - VECTORS_SIZE
23-
}
13+
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
14+
ram (rwx) : ORIGIN = 0x20000000 + 0xB8, LENGTH = 0x00008000 - 0xB8
15+
}
2416

25-
/* Section Definitions */
26-
SECTIONS {
27-
.text :
17+
/* Section Definitions */
18+
SECTIONS {
19+
.text :
2820
{
29-
__data_start__ = .;
30-
. = ALIGN(4);
21+
. = ALIGN(8);
3122
_sfixed = .;
32-
KEEP(*(.isr_vector))
3323
KEEP(*(.vectors .vectors.*))
3424
*(.text .text.* .gnu.linkonce.t.*)
3525
*(.glue_7t) *(.glue_7)
3626
*(.rodata .rodata* .gnu.linkonce.r.*)
27+
*(.ARM.extab* .gnu.linkonce.armextab.*)
3728

3829
/* Support C constructors, and C destructors in both user code
3930
and the C library. This also provides support for C++ code. */
@@ -69,30 +60,21 @@ SECTIONS {
6960
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
7061
KEEP (*(SORT(.dtors.*)))
7162
KEEP (*crtend.o(.dtors))
72-
KEEP(*(.jcr*))
73-
74-
KEEP(*(.eh_frame*))
7563

7664
. = ALIGN(8);
7765
_efixed = .; /* End of text section */
7866
} > rom
7967

80-
.ARM.extab :
81-
{
82-
*(.ARM.extab* .gnu.linkonce.armextab.*)
83-
} > rom
84-
8568
/* .ARM.exidx is sorted, so has to go in its own output section. */
86-
__exidx_start = .;
87-
.ARM.exidx :
69+
PROVIDE_HIDDEN (__exidx_start = .);
70+
.ARM.exidx :
8871
{
8972
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
9073
} > rom
91-
__exidx_end = .;
74+
PROVIDE_HIDDEN (__exidx_end = .);
9275

9376
. = ALIGN(8);
9477
_etext = .;
95-
__etext = .;
9678

9779
.relocate :
9880
AT (_etext)
@@ -103,43 +85,42 @@ SECTIONS {
10385
*(.data .data.*);
10486
. = ALIGN(8);
10587
_erelocate = .;
106-
__data_end__ = .;
10788
} > ram
10889

10990
/* .bss section which is used for uninitialized data */
11091
.bss (NOLOAD) :
11192
{
112-
. = ALIGN(4);
113-
__bss_start__ = .;
93+
. = ALIGN(8);
11494
_sbss = . ;
11595
_szero = .;
11696
*(.bss .bss.*)
11797
*(COMMON)
11898
. = ALIGN(8);
11999
_ebss = . ;
120100
_ezero = .;
121-
__bss_end__ = .;
122101
} > ram
123102

124-
.heap (COPY):
103+
.heap (NOLOAD) :
125104
{
126-
__end__ = .;
127-
PROVIDE(end = .);
128-
__HeapBase = .;
129-
*(.heap*)
105+
. = ALIGN(8);
106+
__end__ = . ;
130107
. = ORIGIN(ram) + LENGTH(ram) - STACK_SIZE;
131-
__HeapLimit = .;
132-
__heap_limit = .; /* Add for _sbrk */
108+
} > ram
109+
110+
/* stack section */
111+
.stack (NOLOAD):
112+
{
113+
. = ALIGN(8);
114+
_sstack = .;
115+
. = . + STACK_SIZE;
116+
. = ALIGN(8);
117+
_estack = .;
133118
} > ram
134119

135120
/* Set stack top to end of RAM, and stack limit move down by
136121
* size of stack_dummy section */
137-
__StackTop = ORIGIN(ram) + LENGTH(ram);
122+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
138123
__StackLimit = __StackTop - STACK_SIZE;
139-
PROVIDE(__stack = __StackTop);
140-
141-
_sstack = __StackTop;
142-
_estack = __StackLimit;
143124

144125
. = ALIGN(8);
145126
}

0 commit comments

Comments
 (0)