Commit | Line | Data |
---|---|---|
3f8107ab AM |
1 | TORS=".tors : |
2 | { | |
3 | ___ctors = . ; | |
4 | *(.ctors) | |
5 | ___ctors_end = . ; | |
6 | ___dtors = . ; | |
7 | *(.dtors) | |
8 | ___dtors_end = . ; | |
9 | . = ALIGN(4); | |
10 | } > ram" | |
11 | ||
12 | cat <<EOF | |
13 | OUTPUT_FORMAT("${OUTPUT_FORMAT}") | |
14 | OUTPUT_ARCH(${ARCH}) | |
15 | ${LIB_SEARCH_DIRS} | |
16 | ||
1dc8bf19 | 17 | /* Allow the command line to override the memory region sizes. */ |
3a5ce950 | 18 | __PMSIZE = DEFINED(__PMSIZE) ? __PMSIZE : 256K; |
1dc8bf19 NC |
19 | __RAMSIZE = DEFINED(__RAMSIZE) ? __RAMSIZE : 64K; |
20 | ||
3f8107ab AM |
21 | MEMORY |
22 | { | |
1dc8bf19 NC |
23 | flash (rx) : ORIGIN = 0, LENGTH = __PMSIZE |
24 | ram (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE | |
3f8107ab | 25 | } |
1dc8bf19 | 26 | |
3f8107ab AM |
27 | SECTIONS |
28 | { | |
29 | .text : | |
30 | { | |
31 | *(.text*) | |
32 | *(.strings) | |
33 | *(._pm*) | |
34 | *(.init) | |
35 | *(.fini) | |
36 | ${RELOCATING+ _etext = . ; } | |
37 | . = ALIGN(4); | |
38 | } ${RELOCATING+ > flash} | |
39 | ${CONSTRUCTING+${TORS}} | |
d1f70bdc | 40 | .data : ${RELOCATING+ AT (ADDR (.text) + SIZEOF (.text))} |
3f8107ab AM |
41 | { |
42 | *(.data) | |
43 | *(.rodata) | |
44 | *(.rodata*) | |
45 | ${RELOCATING+ _edata = . ; } | |
3a5ce950 | 46 | . = ALIGN(4); |
3f8107ab | 47 | } ${RELOCATING+ > ram} |
d1f70bdc | 48 | .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : |
3f8107ab AM |
49 | { |
50 | ${RELOCATING+ _bss_start = . ; } | |
51 | *(.bss) | |
52 | *(COMMON) | |
53 | ${RELOCATING+ _end = . ; } | |
3a5ce950 | 54 | . = ALIGN(4); |
3f8107ab AM |
55 | } ${RELOCATING+ > ram} |
56 | ||
57 | ${RELOCATING+ __data_load_start = LOADADDR(.data); } | |
58 | ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); } | |
59 | ||
60 | .stab 0 ${RELOCATING+(NOLOAD)} : | |
61 | { | |
62 | *(.stab) | |
63 | } | |
64 | .stabstr 0 ${RELOCATING+(NOLOAD)} : | |
65 | { | |
66 | *(.stabstr) | |
67 | } | |
d1f70bdc NC |
68 | EOF |
69 | ||
70 | . $srcdir/scripttempl/DWARF.sc | |
71 | ||
72 | cat <<EOF | |
3f8107ab AM |
73 | } |
74 | EOF |