1 | /***********************************************************************/
|
2 | /* ROM.ld: Linker Script File */
|
3 | /***********************************************************************/
|
4 | ENTRY(_boot)
|
5 | STACK_SIZE = 0x400;
|
6 |
|
7 | /* Memory Definitions */
|
8 | MEMORY
|
9 | {
|
10 | ROM (rx) : ORIGIN = 0x00000000, LENGTH = 512k
|
11 | RAM (rw) : ORIGIN = 0x40000000, LENGTH = 32k
|
12 | }
|
13 |
|
14 | /* Section Definitions */
|
15 | SECTIONS
|
16 | {
|
17 | /* first section is .text which is used for code */
|
18 | .text :
|
19 | {
|
20 | /* *crt0.o (.text) */ /* Startup code */
|
21 | KEEP(*(.init)) /* Startup code from .init-section */
|
22 | *(.text .text.*) /* remaining code */
|
23 | *(.gnu.linkonce.t.*)
|
24 | *(.glue_7)
|
25 | *(.glue_7t)
|
26 | *(.gcc_except_table)
|
27 | *(.rodata) /* read-only data (constants) */
|
28 | *(.rodata*)
|
29 | *(.gnu.linkonce.r.*)
|
30 | } > RAM
|
31 |
|
32 | /***** old:
|
33 | .text :
|
34 | {
|
35 | *crt0.o (.text)
|
36 | *(.text)
|
37 | *(.rodata)
|
38 | *(.rodata*)
|
39 | *(.glue_7)
|
40 | *(.glue_7t)
|
41 | } > ROM
|
42 | *****/
|
43 |
|
44 | . = ALIGN(4);
|
45 |
|
46 | /* .ctors .dtors are used for c++ constructors/destructors */
|
47 | /* added by Martin Thomas 4/2005 based on Anglia Design example */
|
48 | .ctors :
|
49 | {
|
50 | PROVIDE(__ctors_start__ = .);
|
51 | KEEP(*(SORT(.ctors.*)))
|
52 | KEEP(*(.ctors))
|
53 | PROVIDE(__ctors_end__ = .);
|
54 | } >RAM
|
55 |
|
56 | .dtors :
|
57 | {
|
58 | PROVIDE(__dtors_start__ = .);
|
59 | KEEP(*(SORT(.dtors.*)))
|
60 | KEEP(*(.dtors))
|
61 | PROVIDE(__dtors_end__ = .);
|
62 | } >RAM
|
63 |
|
64 | . = ALIGN(4);
|
65 | /* mthomas - end */
|
66 |
|
67 | _etext = . ;
|
68 | PROVIDE (etext = .);
|
69 |
|
70 | /* .data section which is used for initialized data */
|
71 | .data : AT (_etext)
|
72 | {
|
73 | _data = .;
|
74 | *(.data)
|
75 | *(.data.*)
|
76 | *(.gnu.linkonce.d*)
|
77 | SORT(CONSTRUCTORS) /* mt 4/2005 */
|
78 | . = ALIGN(4);
|
79 | *(.fastrun) /* !!!! "RAM-Function" example */
|
80 | } > RAM
|
81 |
|
82 | . = ALIGN(4);
|
83 | _edata = . ;
|
84 | PROVIDE (edata = .);
|
85 |
|
86 | /* .bss section which is used for uninitialized data */
|
87 | .bss (NOLOAD) :
|
88 | {
|
89 | __bss_start = . ;
|
90 | __bss_start__ = . ;
|
91 | *(.bss)
|
92 | *(.gnu.linkonce.b*)
|
93 | *(COMMON)
|
94 | . = ALIGN(4);
|
95 | } > RAM
|
96 |
|
97 | . = ALIGN(4);
|
98 | __bss_end__ = . ;
|
99 | PROVIDE (__bss_end = .);
|
100 |
|
101 | .stack ALIGN(256) :
|
102 | {
|
103 | . += STACK_SIZE;
|
104 | PROVIDE (_stack = .);
|
105 | } > RAM
|
106 |
|
107 | _end = . ;
|
108 | PROVIDE (end = .);
|
109 |
|
110 | /* Stabs debugging sections. */
|
111 | .stab 0 : { *(.stab) }
|
112 | .stabstr 0 : { *(.stabstr) }
|
113 | .stab.excl 0 : { *(.stab.excl) }
|
114 | .stab.exclstr 0 : { *(.stab.exclstr) }
|
115 | .stab.index 0 : { *(.stab.index) }
|
116 | .stab.indexstr 0 : { *(.stab.indexstr) }
|
117 | .comment 0 : { *(.comment) }
|
118 | /* DWARF debug sections.
|
119 | Symbols in the DWARF debugging sections are relative to the beginning
|
120 | of the section so we begin them at 0. */
|
121 | /* DWARF 1 */
|
122 | .debug 0 : { *(.debug) }
|
123 | .line 0 : { *(.line) }
|
124 | /* GNU DWARF 1 extensions */
|
125 | .debug_srcinfo 0 : { *(.debug_srcinfo) }
|
126 | .debug_sfnames 0 : { *(.debug_sfnames) }
|
127 | /* DWARF 1.1 and DWARF 2 */
|
128 | .debug_aranges 0 : { *(.debug_aranges) }
|
129 | .debug_pubnames 0 : { *(.debug_pubnames) }
|
130 | /* DWARF 2 */
|
131 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
132 | .debug_abbrev 0 : { *(.debug_abbrev) }
|
133 | .debug_line 0 : { *(.debug_line) }
|
134 | .debug_frame 0 : { *(.debug_frame) }
|
135 | .debug_str 0 : { *(.debug_str) }
|
136 | .debug_loc 0 : { *(.debug_loc) }
|
137 | .debug_macinfo 0 : { *(.debug_macinfo) }
|
138 | /* SGI/MIPS DWARF 2 extensions */
|
139 | .debug_weaknames 0 : { *(.debug_weaknames) }
|
140 | .debug_funcnames 0 : { *(.debug_funcnames) }
|
141 | .debug_typenames 0 : { *(.debug_typenames) }
|
142 | .debug_varnames 0 : { *(.debug_varnames) }
|
143 | }
|