Guest User

Untitled

a guest
Mar 23rd, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.73 KB | None | 0 0
  1. /******************************************************************************
  2. * author: Freddie Chopin, http://www.freddiechopin.info/
  3. * file: stm32f103rb_ram.ld
  4. * last change: 2010-04-02
  5. *
  6. * chip: STM32F100RB
  7. * compiler: arm-none-eabi-gcc (Sourcery G++ Lite 2009q3-68) 4.4.1
  8. *
  9. * description:
  10. * Linker script for STM32F103RB chip (128kB Flash, 20kB SRAM).
  11. ******************************************************************************/
  12.  
  13. SEARCH_DIR(.);
  14.  
  15. /*
  16. +=============================================================================+
  17. | format configurations
  18. +=============================================================================+
  19. */
  20.  
  21. OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm");
  22. OUTPUT_ARCH(arm);
  23.  
  24. /*
  25. +=============================================================================+
  26. | stacks sizes
  27. +=============================================================================+
  28. */
  29.  
  30. /* Handler mode (core exceptions / interrupts) can use only main stack */
  31. /* Thread mode can use main stack (default) or process stack - selected in CONTROL special register */
  32.  
  33. __main_stack_size = 1024;
  34. __process_stack_size = 1024;
  35.  
  36. PROVIDE(__main_stack_size = __main_stack_size);
  37. PROVIDE(__process_stack_size = __process_stack_size);
  38.  
  39. /*
  40. +=============================================================================+
  41. | available memories definitions
  42. +=============================================================================+
  43. */
  44.  
  45. MEMORY
  46. {
  47. ram (rwx) : org = 0x20000000, len = 8k
  48. }
  49.  
  50. __ram_start = ORIGIN(ram);
  51. __ram_size = LENGTH(ram);
  52. __ram_end = __ram_start + __ram_size;
  53.  
  54. PROVIDE(__ram_start = __ram_start);
  55. PROVIDE(__ram_size = __ram_size);
  56. PROVIDE(__ram_end = __ram_end);
  57.  
  58. /*
  59. +=============================================================================+
  60. | entry point
  61. +=============================================================================+
  62. */
  63.  
  64. ENTRY(Reset_Handler);
  65.  
  66. /*
  67. +=============================================================================+
  68. | put data in sections
  69. +=============================================================================+
  70. */
  71.  
  72. SECTIONS
  73. {
  74. .text :
  75. {
  76. . = ALIGN(4);
  77. __text_start = .;
  78. PROVIDE(__text_start = __text_start);
  79.  
  80. . = ALIGN(4);
  81. KEEP(*(.vectors));
  82. . = ALIGN(4);
  83. *(.text .text.* .gnu.linkonce.t.*);
  84. . = ALIGN(4);
  85. *(.glue_7t .glue_7);
  86. . = ALIGN(4);
  87. *(.rodata .rodata.* .gnu.linkonce.r.*);
  88.  
  89. . = ALIGN(4);
  90. *(.ARM.extab* .gnu.linkonce.armextab.*); /* exception unwinding information */
  91. . = ALIGN(4);
  92. *(.gcc_except_table); /* information used for stack unwinding during exception */
  93. . = ALIGN(4);
  94. *(.eh_frame_hdr); /* additional information about .ex_frame section */
  95. . = ALIGN(4);
  96. *(.eh_frame); /* information used for stack unwinding during exception */
  97.  
  98. . = ALIGN(4);
  99. KEEP(*(.init));
  100. . = ALIGN(4);
  101. __preinit_array_start = .;
  102. KEEP(*(.preinit_array));
  103. . = ALIGN(4);
  104. __preinit_array_end = .;
  105. __init_array_start = .;
  106. KEEP(*(SORT(.init_array.*)));
  107. . = ALIGN(4);
  108. KEEP(*(.init_array));
  109. . = ALIGN(4);
  110. __init_array_end = .;
  111. KEEP(*(.fini));
  112. . = ALIGN(4);
  113. __fini_array_start = .;
  114. KEEP(*(.fini_array));
  115. . = ALIGN(4);
  116. KEEP(*(SORT(.fini_array.*)));
  117. . = ALIGN(4);
  118. __fini_array_end = .;
  119.  
  120. . = ALIGN(4);
  121. __text_end = .;
  122. PROVIDE(__text_end = __text_end);
  123. } > ram AT > ram
  124.  
  125. . = ALIGN(4);
  126. __exidx_start = .;
  127. PROVIDE(__exidx_start = __exidx_start);
  128.  
  129. .ARM.exidx :
  130. {
  131. *(.ARM.exidx* .gnu.linkonce.armexidx.*);
  132. } > ram AT > ram /* index entries for section unwinding */
  133.  
  134. . = ALIGN(4);
  135. __exidx_end = .;
  136. PROVIDE(__exidx_end = __exidx_end);
  137.  
  138. .data :
  139. {
  140. . = ALIGN(4);
  141. __data_init_start = LOADADDR (.data);
  142. PROVIDE(__data_init_start = __data_init_start);
  143. __data_start = .;
  144. PROVIDE(__data_start = __data_start);
  145.  
  146. . = ALIGN(4);
  147. *(.data .data.* .gnu.linkonce.d.*)
  148.  
  149. . = ALIGN(4);
  150. __data_end = .;
  151. PROVIDE(__data_end = __data_end);
  152. } > ram AT > ram
  153.  
  154. .bss :
  155. {
  156. . = ALIGN(4);
  157. __bss_start = .;
  158. PROVIDE(__bss_start = __bss_start);
  159.  
  160. . = ALIGN(4);
  161. *(.bss .bss.* .gnu.linkonce.b.*)
  162. . = ALIGN(4);
  163. *(COMMON);
  164.  
  165. . = ALIGN(4);
  166. __bss_end = .;
  167. PROVIDE(__bss_end = __bss_end);
  168. } > ram AT > ram
  169.  
  170. .stack :
  171. {
  172. . = ALIGN(8);
  173. __stack_start = .;
  174. PROVIDE(__stack_start = __stack_start);
  175.  
  176. . = ALIGN(8);
  177. __main_stack_start = .;
  178. PROVIDE(__main_stack_start = __main_stack_start);
  179.  
  180. . += __main_stack_size;
  181.  
  182. . = ALIGN(8);
  183. __main_stack_end = .;
  184. PROVIDE(__main_stack_end = __main_stack_end);
  185.  
  186. . = ALIGN(8);
  187. __process_stack_start = .;
  188. PROVIDE(__process_stack_start = __process_stack_start);
  189.  
  190. . += __process_stack_size;
  191.  
  192. . = ALIGN(8);
  193. __process_stack_end = .;
  194. PROVIDE(__process_stack_end = __process_stack_end);
  195.  
  196. . = ALIGN(8);
  197. __stack_end = .;
  198. PROVIDE(__stack_end = __stack_end);
  199. } > ram AT > ram
  200.  
  201. . = ALIGN(4);
  202. __heap_start = .;
  203. PROVIDE(__heap_start = __heap_start);
  204.  
  205. . = ALIGN(4);
  206. __heap_end = __ram_end;
  207. PROVIDE(__heap_end = __heap_end);
  208.  
  209. .stab 0 (NOLOAD) : { *(.stab) }
  210. .stabstr 0 (NOLOAD) : { *(.stabstr) }
  211. /* DWARF debug sections.
  212. * Symbols in the DWARF debugging sections are relative to the beginning
  213. * of the section so we begin them at 0. */
  214. /* DWARF 1 */
  215. .debug 0 : { *(.debug) }
  216. .line 0 : { *(.line) }
  217. /* GNU DWARF 1 extensions */
  218. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  219. .debug_sfnames 0 : { *(.debug_sfnames) }
  220. /* DWARF 1.1 and DWARF 2 */
  221. .debug_aranges 0 : { *(.debug_aranges) }
  222. .debug_pubnames 0 : { *(.debug_pubnames) }
  223. /* DWARF 2 */
  224. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  225. .debug_abbrev 0 : { *(.debug_abbrev) }
  226. .debug_line 0 : { *(.debug_line) }
  227. .debug_frame 0 : { *(.debug_frame) }
  228. .debug_str 0 : { *(.debug_str) }
  229. .debug_loc 0 : { *(.debug_loc) }
  230. .debug_macinfo 0 : { *(.debug_macinfo) }
  231. /* SGI/MIPS DWARF 2 extensions */
  232. .debug_weaknames 0 : { *(.debug_weaknames) }
  233. .debug_funcnames 0 : { *(.debug_funcnames) }
  234. .debug_typenames 0 : { *(.debug_typenames) }
  235. .debug_varnames 0 : { *(.debug_varnames) }
  236.  
  237. .note.gnu.arm.ident 0 : { KEEP(*(.note.gnu.arm.ident)) }
  238. .ARM.attributes 0 : { KEEP(*(.ARM.attributes)) }
  239. /DISCARD/ : { *(.note.GNU-stack) }
  240. }
  241.  
  242. PROVIDE(__text_size = __text_end - __text_start);
  243. PROVIDE(__exidx_size = __exidx_end - __exidx_start);
  244. PROVIDE(__data_size = __data_end - __data_start);
  245. PROVIDE(__bss_size = __bss_end - __bss_start);
  246. PROVIDE(__stack_size = __stack_end - __stack_start);
  247. PROVIDE(__heap_size = __heap_end - __heap_start);
  248.  
  249. /******************************************************************************
  250. * END OF FILE
  251. ******************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment