fsp_gen.ld 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. MEMORY
  2. {
  3. RAM (rwx) : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
  4. FLASH (rx) : ORIGIN = FLASH_START, LENGTH = FLASH_LENGTH
  5. DATA_FLASH (rx) : ORIGIN = DATA_FLASH_START, LENGTH = DATA_FLASH_LENGTH
  6. OPTION_SETTING_OFS0 (r) : ORIGIN = OPTION_SETTING_OFS0_START, LENGTH = OPTION_SETTING_OFS0_LENGTH
  7. OPTION_SETTING_OFS1 (r) : ORIGIN = OPTION_SETTING_OFS1_START, LENGTH = OPTION_SETTING_OFS1_LENGTH
  8. OPTION_SETTING_SECMPU (r) : ORIGIN = OPTION_SETTING_SECMPU_START, LENGTH = OPTION_SETTING_SECMPU_LENGTH
  9. OPTION_SETTING_OSIS (r) : ORIGIN = OPTION_SETTING_OSIS_START, LENGTH = OPTION_SETTING_OSIS_LENGTH
  10. FLASH_GAP (rx) : ORIGIN = FLASH_GAP_START, LENGTH = FLASH_GAP_LENGTH
  11. }
  12. /* code entry point...need to define to keep crt0 _start out */
  13. ENTRY( Reset_Handler)
  14. /* Library configurations */
  15. GROUP(libgcc.a libc.a libm.a)
  16. SECTIONS
  17. {
  18. .text :
  19. {
  20. /* section information for finsh shell */
  21. . = ALIGN(4);
  22. __fsymtab_start = .;
  23. KEEP(*(FSymTab))
  24. __fsymtab_end = .;
  25. . = ALIGN(4);
  26. __vsymtab_start = .;
  27. KEEP(*(VSymTab))
  28. __vsymtab_end = .;
  29. /* section information for initial. */
  30. . = ALIGN(4);
  31. __rt_init_start = .;
  32. KEEP(*(SORT(.rti_fn*)))
  33. __rt_init_end = .;
  34. . = ALIGN(4);
  35. KEEP(*(FalPartTable))
  36. }> FLASH
  37. /***** DATA_FLASH memory section allocations ******/
  38. .data_flash.startof :
  39. {
  40. __ddsc_DATA_FLASH_START = .;
  41. }> DATA_FLASH
  42. /***** RAM memory section allocations ******/
  43. .ram.startof :
  44. {
  45. __ddsc_RAM_START = .;
  46. }> RAM
  47. __ram_dtc_vector$$ (NOLOAD) :
  48. {
  49. __ram_dtc_vector$$Base = .;
  50. *(.fsp_dtc_vector_table)
  51. __ram_dtc_vector$$Limit = .;
  52. }> RAM
  53. /* ram initialized from data_flash */
  54. __ram_from_data_flash$$ :
  55. {
  56. __ram_from_data_flash$$Base = .;__ram_from_data_flash$$Load = LOADADDR(__ram_from_data_flash$$);
  57. /* section.ram.from_data_flash */
  58. *(.ram_from_data_flash)
  59. /* section.ram.code_from_data_flash */
  60. *(.ram_code_from_data_flash)
  61. __ram_from_data_flash$$Limit = .;
  62. }> RAM AT > DATA_FLASH
  63. __data_flash_readonly$$ :
  64. {
  65. __data_flash_readonly$$Base = .;
  66. /* section.data_flash.readonly */
  67. *(.data_flash)
  68. /* section.data_flash.code */
  69. *(.data_flash_code)
  70. __data_flash_readonly$$Limit = .;
  71. }> DATA_FLASH
  72. __data_flash_noinit$$ (NOLOAD) :
  73. {
  74. __data_flash_noinit$$Base = .;
  75. /* section.data_flash.noinit */
  76. *(.data_flash_noinit)
  77. __data_flash_noinit$$Limit = .;
  78. }> DATA_FLASH
  79. .data_flash.endof :
  80. {
  81. . = ALIGN(512);
  82. __ddsc_DATA_FLASH_END = .;
  83. }> DATA_FLASH
  84. /***** FLASH memory section allocations ******/
  85. .flash.startof :
  86. {
  87. __ddsc_FLASH_START = .;
  88. }> FLASH_GAP
  89. /* MCU vector table */
  90. __flash_vectors$$ :
  91. {
  92. __flash_vectors$$Base = .; _VECTORS = .;
  93. KEEP(*(.fixed_vectors))
  94. KEEP(*(.application_vectors))
  95. __flash_vectors$$Limit = .;
  96. }> FLASH_GAP
  97. /* Sections that can be used to fill flash gap */
  98. __flash_readonly_gap$$ :
  99. {
  100. __flash_readonly_gap$$Base = .;
  101. /* section.flash.readonly_gap */
  102. *bsp_linker.?*(.rodata.*)
  103. *(.flash_gap)
  104. /* section.flash.code_gap */
  105. *startup.?*(.text.Reset_Handler)
  106. *system.?*(.text.*)
  107. *(.flash_gap_code)
  108. __flash_readonly_gap$$Limit = .;
  109. }> FLASH_GAP
  110. /***** FLASH memory section allocations ******/
  111. __flash_noinit$$ (NOLOAD) :
  112. {
  113. __flash_noinit$$Base = .;
  114. /* section.flash.noinit */
  115. *(.flash_noinit)
  116. __flash_noinit$$Limit = .;
  117. }> FLASH
  118. /***** RAM memory section allocations ******/
  119. /* ram initialized from flash */
  120. __ram_from_flash$$ :
  121. {
  122. __ram_from_flash$$Base = .;__ram_from_flash$$Load = LOADADDR(__ram_from_flash$$);
  123. /* section.ram.from_flash */
  124. *(.ram_from_flash)
  125. /* section.ram.code_from_flash */
  126. *(.ram_code_from_flash)
  127. *(.data*)
  128. *(vtable)
  129. __ram_from_flash$$Limit = .;
  130. }> RAM AT > FLASH
  131. /* Non-initialized ram */
  132. __ram_noinit$$ (NOLOAD) :
  133. {
  134. __ram_noinit$$Base = .;
  135. /* section.ram.noinit */
  136. *(.bss.g_heap)
  137. *(.bss.g_main_stack)
  138. *(.ram_noinit)
  139. *(.noinit)
  140. __ram_noinit$$Limit = .;
  141. }> RAM
  142. /* Zeroed ram */
  143. __ram_zero$$ (NOLOAD) :
  144. {
  145. __ram_zero$$Base = .;
  146. /* section.ram.zero */
  147. *(.ram)
  148. *(.bss*)
  149. __ram_zero$$Limit = .;
  150. }> RAM
  151. /* Thread Stacks */
  152. __ram_thread_stack$$ (NOLOAD) : ALIGN(8)
  153. {
  154. __ram_thread_stack$$Base = .;
  155. KEEP(*(.stack?*))
  156. __ram_thread_stack$$Limit = .;
  157. }> RAM
  158. .ram.endof ALIGN(.,512) :
  159. {
  160. __ddsc_RAM_END = .;
  161. }> RAM
  162. __flash_readonly$$ :
  163. {
  164. __flash_readonly$$Base = .;
  165. /* section.flash.readonly */
  166. *(.flash)
  167. /* section.flash.code */
  168. *(.flash_code)
  169. *(.text*)
  170. *(.rodata*)
  171. KEEP(*(.mcuboot_sce9_key))
  172. KEEP(*(.version))
  173. __flash_readonly$$Limit = .;
  174. }> FLASH
  175. __flash_ctor$$ :
  176. {
  177. *crtbegin.o(.ctors)
  178. *crtbegin?.o(.ctors)
  179. EXCLUDE_FILE (*crtend?.o *crtend.o) *(.ctors)
  180. *(SORT(.ctors.*))
  181. *(.ctors)
  182. *crtbegin.o(.dtors)
  183. *crtbegin?.o(.dtors)
  184. EXCLUDE_FILE (*crtend?.o *crtend.o) *(.dtors)
  185. *(SORT(.dtors.*))
  186. *(.dtors)
  187. }> FLASH
  188. __flash_preinit_array$$ :
  189. {
  190. __preinit_array_start = .;
  191. KEEP(*(.preinit_array))
  192. __preinit_array_end = .;
  193. }> FLASH
  194. __flash_.got$$ :
  195. {
  196. *(.got.plt)
  197. *(.got)
  198. }> FLASH
  199. __flash_init_array$$ :
  200. {
  201. __init_array_start = .;
  202. KEEP(*(SORT(.init_array.*)))
  203. KEEP(*(.init_array))
  204. __init_array_end = .;
  205. }> FLASH
  206. __flash_fini_array$$ :
  207. {
  208. __fini_array_start = .;
  209. KEEP(*(SORT(.fini_array.*)))
  210. KEEP(*(.fini_array))
  211. __fini_array_end = .;
  212. }> FLASH
  213. /* Discard exception tables */
  214. /DISCARD/ :
  215. {
  216. *(.ARM.extab*)
  217. *(.gnu.linkonce.armextab.*)
  218. *(.ARM.exidx*)
  219. *(.gnu.linkonce.armexidx.*)
  220. }> FLASH
  221. /* Dummy section to hold required exidx labels */
  222. __flash_arm.exidx$$ :
  223. {
  224. __exidx_start = .;
  225. __exidx_end = .;
  226. }> FLASH
  227. .flash.endof :
  228. {
  229. . = ALIGN(512);
  230. __ddsc_FLASH_END = .;
  231. }> FLASH
  232. /***** OPTION_SETTING_OFS0 memory section allocations ******/
  233. .option_setting_ofs0.startof :
  234. {
  235. __ddsc_OPTION_SETTING_OFS0_START = .;
  236. }> OPTION_SETTING_OFS0
  237. /* Option Function Select Register 0 */
  238. __option_setting_ofs0_reg$$ :
  239. {
  240. __option_setting_ofs0_reg$$Base = .;
  241. KEEP(*(.option_setting_ofs0))
  242. __option_setting_ofs0_reg$$Limit = .;
  243. }> OPTION_SETTING_OFS0
  244. .option_setting_ofs0.endof :
  245. {
  246. __ddsc_OPTION_SETTING_OFS0_END = .;
  247. }> OPTION_SETTING_OFS0
  248. /***** OPTION_SETTING_OFS1 memory section allocations ******/
  249. .option_setting_ofs1.startof :
  250. {
  251. __ddsc_OPTION_SETTING_OFS1_START = .;
  252. }> OPTION_SETTING_OFS1
  253. /* Option Function Select Register 1 */
  254. __option_setting_ofs1_reg$$ :
  255. {
  256. __option_setting_ofs1_reg$$Base = .;
  257. KEEP(*(.option_setting_ofs1))
  258. __option_setting_ofs1_reg$$Limit = .;
  259. }> OPTION_SETTING_OFS1
  260. .option_setting_ofs1.endof :
  261. {
  262. __ddsc_OPTION_SETTING_OFS1_END = .;
  263. }> OPTION_SETTING_OFS1
  264. /***** OPTION_SETTING_SECMPU memory section allocations ******/
  265. .option_setting_secmpu.startof :
  266. {
  267. __ddsc_OPTION_SETTING_SECMPU_START = .;
  268. }> OPTION_SETTING_SECMPU
  269. /* Security MPU Registers */
  270. __option_setting_secmpu_reg$$ :
  271. {
  272. __option_setting_secmpu_reg$$Base = .;
  273. KEEP(*(.option_setting_secmpu))
  274. __option_setting_secmpu_reg$$Limit = .;
  275. }> OPTION_SETTING_SECMPU
  276. .option_setting_secmpu.endof :
  277. {
  278. __ddsc_OPTION_SETTING_SECMPU_END = .;
  279. }> OPTION_SETTING_SECMPU
  280. /***** OPTION_SETTING_OSIS memory section allocations ******/
  281. .option_setting_osis.startof :
  282. {
  283. __ddsc_OPTION_SETTING_OSIS_START = .;
  284. }> OPTION_SETTING_OSIS
  285. /* OCD/Serial Programmer ID setting register */
  286. __option_setting_osis_reg$$ :
  287. {
  288. __option_setting_osis_reg$$Base = .;
  289. KEEP(*(.option_setting_osis))
  290. __option_setting_osis_reg$$Limit = .;
  291. }> OPTION_SETTING_OSIS
  292. .option_setting_osis.endof :
  293. {
  294. __ddsc_OPTION_SETTING_OSIS_END = .;
  295. }> OPTION_SETTING_OSIS
  296. }