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