|
1 | | -/* |
2 | | - * linker script for STM32F4xx with GNU ld |
3 | | - * bernard.xiong 2009-10-14 |
4 | | - */ |
5 | | - |
6 | | -/* Program Entry, set to mark it as "used" and avoid gc */ |
7 | | -MEMORY |
8 | | -{ |
9 | | - ROM (rx) : ORIGIN = 0x08000000, LENGTH = 2048k /* 2048KB flash */ |
10 | | - RAM (rw) : ORIGIN = 0x20000000, LENGTH = 512k /* 512K sram */ |
11 | | -} |
12 | | -ENTRY(Reset_Handler) |
13 | | -_system_stack_size = 0x200; |
14 | | - |
15 | | -SECTIONS |
16 | | -{ |
17 | | - .text : |
18 | | - { |
19 | | - . = ALIGN(4); |
20 | | - _stext = .; |
21 | | - KEEP(*(.isr_vector)) /* Startup code */ |
22 | | - |
23 | | - . = ALIGN(4); |
24 | | - *(.text) /* remaining code */ |
25 | | - *(.text.*) /* remaining code */ |
26 | | - *(.rodata) /* read-only data (constants) */ |
27 | | - *(.rodata*) |
28 | | - *(.glue_7) |
29 | | - *(.glue_7t) |
30 | | - *(.gnu.linkonce.t*) |
31 | | - |
32 | | - /* section information for finsh shell */ |
33 | | - . = ALIGN(4); |
34 | | - __fsymtab_start = .; |
35 | | - KEEP(*(FSymTab)) |
36 | | - __fsymtab_end = .; |
37 | | - |
38 | | - . = ALIGN(4); |
39 | | - __vsymtab_start = .; |
40 | | - KEEP(*(VSymTab)) |
41 | | - __vsymtab_end = .; |
42 | | - |
43 | | - /* section information for initial. */ |
44 | | - . = ALIGN(4); |
45 | | - __rt_init_start = .; |
46 | | - KEEP(*(SORT(.rti_fn*))) |
47 | | - __rt_init_end = .; |
48 | | - |
49 | | - . = ALIGN(4); |
50 | | - _etext = .; |
51 | | - } > ROM = 0 |
52 | | - |
53 | | - /* .ARM.exidx is sorted, so has to go in its own output section. */ |
54 | | - __exidx_start = .; |
55 | | - .ARM.exidx : |
56 | | - { |
57 | | - *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
58 | | - |
59 | | - /* This is used by the startup in order to initialize the .data secion */ |
60 | | - _sidata = .; |
61 | | - } > ROM |
62 | | - __exidx_end = .; |
63 | | - |
64 | | - /* .data section which is used for initialized data */ |
65 | | - |
66 | | - .data : AT (_sidata) |
67 | | - { |
68 | | - . = ALIGN(4); |
69 | | - /* This is used by the startup in order to initialize the .data secion */ |
70 | | - _sdata = . ; |
71 | | - |
72 | | - *(.data) |
73 | | - *(.data.*) |
74 | | - *(.gnu.linkonce.d*) |
75 | | - |
76 | | - . = ALIGN(4); |
77 | | - /* This is used by the startup in order to initialize the .data secion */ |
78 | | - _edata = . ; |
79 | | - } >RAM |
80 | | - |
81 | | - .stack : |
82 | | - { |
83 | | - . = ALIGN(4); |
84 | | - _sstack = .; |
85 | | - . = . + _system_stack_size; |
86 | | - . = ALIGN(4); |
87 | | - _estack = .; |
88 | | - } >RAM |
89 | | - |
90 | | - __bss_start = .; |
91 | | - .bss : |
92 | | - { |
93 | | - . = ALIGN(4); |
94 | | - /* This is used by the startup in order to initialize the .bss secion */ |
95 | | - _sbss = .; |
96 | | - |
97 | | - *(.bss) |
98 | | - *(.bss.*) |
99 | | - *(COMMON) |
100 | | - |
101 | | - . = ALIGN(4); |
102 | | - /* This is used by the startup in order to initialize the .bss secion */ |
103 | | - _ebss = . ; |
104 | | - |
105 | | - *(.bss.init) |
106 | | - } > RAM |
107 | | - __bss_end = .; |
108 | | - |
109 | | - _end = .; |
110 | | - |
111 | | - /* Stabs debugging sections. */ |
112 | | - .stab 0 : { *(.stab) } |
113 | | - .stabstr 0 : { *(.stabstr) } |
114 | | - .stab.excl 0 : { *(.stab.excl) } |
115 | | - .stab.exclstr 0 : { *(.stab.exclstr) } |
116 | | - .stab.index 0 : { *(.stab.index) } |
117 | | - .stab.indexstr 0 : { *(.stab.indexstr) } |
118 | | - .comment 0 : { *(.comment) } |
119 | | - /* DWARF debug sections. |
120 | | - * Symbols in the DWARF debugging sections are relative to the beginning |
121 | | - * of the section so we begin them at 0. */ |
122 | | - /* DWARF 1 */ |
123 | | - .debug 0 : { *(.debug) } |
124 | | - .line 0 : { *(.line) } |
125 | | - /* GNU DWARF 1 extensions */ |
126 | | - .debug_srcinfo 0 : { *(.debug_srcinfo) } |
127 | | - .debug_sfnames 0 : { *(.debug_sfnames) } |
128 | | - /* DWARF 1.1 and DWARF 2 */ |
129 | | - .debug_aranges 0 : { *(.debug_aranges) } |
130 | | - .debug_pubnames 0 : { *(.debug_pubnames) } |
131 | | - /* DWARF 2 */ |
132 | | - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
133 | | - .debug_abbrev 0 : { *(.debug_abbrev) } |
134 | | - .debug_line 0 : { *(.debug_line) } |
135 | | - .debug_frame 0 : { *(.debug_frame) } |
136 | | - .debug_str 0 : { *(.debug_str) } |
137 | | - .debug_loc 0 : { *(.debug_loc) } |
138 | | - .debug_macinfo 0 : { *(.debug_macinfo) } |
139 | | - /* SGI/MIPS DWARF 2 extensions */ |
140 | | - .debug_weaknames 0 : { *(.debug_weaknames) } |
141 | | - .debug_funcnames 0 : { *(.debug_funcnames) } |
142 | | - .debug_typenames 0 : { *(.debug_typenames) } |
143 | | - .debug_varnames 0 : { *(.debug_varnames) } |
144 | | -} |
| 1 | +/* |
| 2 | + * linker script for STM32F4xx with GNU ld |
| 3 | + * bernard.xiong 2009-10-14 |
| 4 | + */ |
| 5 | + |
| 6 | +/* Program Entry, set to mark it as "used" and avoid gc */ |
| 7 | +MEMORY |
| 8 | +{ |
| 9 | + ROM (rx) : ORIGIN = 0x08000000, LENGTH = 2048k /* 2048KB flash */ |
| 10 | + RAM (rw) : ORIGIN = 0x20000000, LENGTH = 512k /* 512K sram */ |
| 11 | +} |
| 12 | +ENTRY(Reset_Handler) |
| 13 | +_system_stack_size = 0x200; |
| 14 | + |
| 15 | +SECTIONS |
| 16 | +{ |
| 17 | + .text : |
| 18 | + { |
| 19 | + . = ALIGN(4); |
| 20 | + _stext = .; |
| 21 | + KEEP(*(.isr_vector)) /* Startup code */ |
| 22 | + |
| 23 | + . = ALIGN(4); |
| 24 | + *(.text) /* remaining code */ |
| 25 | + *(.text.*) /* remaining code */ |
| 26 | + *(.rodata) /* read-only data (constants) */ |
| 27 | + *(.rodata*) |
| 28 | + *(.glue_7) |
| 29 | + *(.glue_7t) |
| 30 | + *(.gnu.linkonce.t*) |
| 31 | + |
| 32 | + /* section information for finsh shell */ |
| 33 | + . = ALIGN(4); |
| 34 | + __fsymtab_start = .; |
| 35 | + KEEP(*(FSymTab)) |
| 36 | + __fsymtab_end = .; |
| 37 | + |
| 38 | + . = ALIGN(4); |
| 39 | + __vsymtab_start = .; |
| 40 | + KEEP(*(VSymTab)) |
| 41 | + __vsymtab_end = .; |
| 42 | + |
| 43 | + /* section information for initial. */ |
| 44 | + . = ALIGN(4); |
| 45 | + __rt_init_start = .; |
| 46 | + KEEP(*(SORT(.rti_fn*))) |
| 47 | + __rt_init_end = .; |
| 48 | + |
| 49 | + . = ALIGN(4); |
| 50 | + _etext = .; |
| 51 | + } > ROM = 0 |
| 52 | + |
| 53 | + /* .ARM.exidx is sorted, so has to go in its own output section. */ |
| 54 | + __exidx_start = .; |
| 55 | + .ARM.exidx : |
| 56 | + { |
| 57 | + *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
| 58 | + |
| 59 | + /* This is used by the startup in order to initialize the .data secion */ |
| 60 | + _sidata = .; |
| 61 | + } > ROM |
| 62 | + __exidx_end = .; |
| 63 | + |
| 64 | + /* .data section which is used for initialized data */ |
| 65 | + |
| 66 | + .data : AT (_sidata) |
| 67 | + { |
| 68 | + . = ALIGN(4); |
| 69 | + /* This is used by the startup in order to initialize the .data secion */ |
| 70 | + _sdata = . ; |
| 71 | + |
| 72 | + *(.data) |
| 73 | + *(.data.*) |
| 74 | + *(.gnu.linkonce.d*) |
| 75 | + |
| 76 | + . = ALIGN(4); |
| 77 | + /* This is used by the startup in order to initialize the .data secion */ |
| 78 | + _edata = . ; |
| 79 | + } >RAM |
| 80 | + |
| 81 | + .stack : |
| 82 | + { |
| 83 | + . = ALIGN(4); |
| 84 | + _sstack = .; |
| 85 | + . = . + _system_stack_size; |
| 86 | + . = ALIGN(4); |
| 87 | + _estack = .; |
| 88 | + } >RAM |
| 89 | + |
| 90 | + __bss_start = .; |
| 91 | + .bss : |
| 92 | + { |
| 93 | + . = ALIGN(4); |
| 94 | + /* This is used by the startup in order to initialize the .bss secion */ |
| 95 | + _sbss = .; |
| 96 | + |
| 97 | + *(.bss) |
| 98 | + *(.bss.*) |
| 99 | + *(COMMON) |
| 100 | + |
| 101 | + . = ALIGN(4); |
| 102 | + /* This is used by the startup in order to initialize the .bss secion */ |
| 103 | + _ebss = . ; |
| 104 | + |
| 105 | + *(.bss.init) |
| 106 | + } > RAM |
| 107 | + __bss_end = .; |
| 108 | + |
| 109 | + _end = .; |
| 110 | + |
| 111 | + /* Stabs debugging sections. */ |
| 112 | + .stab 0 : { *(.stab) } |
| 113 | + .stabstr 0 : { *(.stabstr) } |
| 114 | + .stab.excl 0 : { *(.stab.excl) } |
| 115 | + .stab.exclstr 0 : { *(.stab.exclstr) } |
| 116 | + .stab.index 0 : { *(.stab.index) } |
| 117 | + .stab.indexstr 0 : { *(.stab.indexstr) } |
| 118 | + .comment 0 : { *(.comment) } |
| 119 | + /* DWARF debug sections. |
| 120 | + * Symbols in the DWARF debugging sections are relative to the beginning |
| 121 | + * of the section so we begin them at 0. */ |
| 122 | + /* DWARF 1 */ |
| 123 | + .debug 0 : { *(.debug) } |
| 124 | + .line 0 : { *(.line) } |
| 125 | + /* GNU DWARF 1 extensions */ |
| 126 | + .debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 127 | + .debug_sfnames 0 : { *(.debug_sfnames) } |
| 128 | + /* DWARF 1.1 and DWARF 2 */ |
| 129 | + .debug_aranges 0 : { *(.debug_aranges) } |
| 130 | + .debug_pubnames 0 : { *(.debug_pubnames) } |
| 131 | + /* DWARF 2 */ |
| 132 | + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
| 133 | + .debug_abbrev 0 : { *(.debug_abbrev) } |
| 134 | + .debug_line 0 : { *(.debug_line) } |
| 135 | + .debug_frame 0 : { *(.debug_frame) } |
| 136 | + .debug_str 0 : { *(.debug_str) } |
| 137 | + .debug_loc 0 : { *(.debug_loc) } |
| 138 | + .debug_macinfo 0 : { *(.debug_macinfo) } |
| 139 | + /* SGI/MIPS DWARF 2 extensions */ |
| 140 | + .debug_weaknames 0 : { *(.debug_weaknames) } |
| 141 | + .debug_funcnames 0 : { *(.debug_funcnames) } |
| 142 | + .debug_typenames 0 : { *(.debug_typenames) } |
| 143 | + .debug_varnames 0 : { *(.debug_varnames) } |
| 144 | +} |
0 commit comments