fsp_gen.ld 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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. *(.flash_gap_code)
  106. __flash_readonly_gap$$Limit = .;
  107. }> FLASH_GAP
  108. /***** FLASH memory section allocations ******/
  109. __flash_noinit$$ (NOLOAD) :
  110. {
  111. __flash_noinit$$Base = .;
  112. /* section.flash.noinit */
  113. *(.flash_noinit)
  114. __flash_noinit$$Limit = .;
  115. }> FLASH
  116. /***** RAM memory section allocations ******/
  117. /* ram initialized from flash */
  118. __ram_from_flash$$ :
  119. {
  120. __ram_from_flash$$Base = .;__ram_from_flash$$Load = LOADADDR(__ram_from_flash$$);
  121. /* section.ram.from_flash */
  122. *(.ram_from_flash)
  123. /* section.ram.code_from_flash */
  124. *(.ram_code_from_flash)
  125. *(.data*)
  126. *(vtable)
  127. __ram_from_flash$$Limit = .;
  128. }> RAM AT > FLASH
  129. /* Non-initialized ram */
  130. __ram_noinit$$ (NOLOAD) :
  131. {
  132. __ram_noinit$$Base = .;
  133. /* section.ram.noinit */
  134. *(.bss.g_heap)
  135. *(.bss.g_main_stack)
  136. *(.ram_noinit)
  137. *(.noinit)
  138. __ram_noinit$$Limit = .;
  139. }> RAM
  140. /* Zeroed ram */
  141. __ram_zero$$ (NOLOAD) :
  142. {
  143. __ram_zero$$Base = .;
  144. /* section.ram.zero */
  145. *(.ram)
  146. *(.bss*)
  147. __ram_zero$$Limit = .;
  148. }> RAM
  149. /* Thread Stacks */
  150. __ram_thread_stack$$ (NOLOAD) : ALIGN(8)
  151. {
  152. __ram_thread_stack$$Base = .;
  153. KEEP(*(.stack?*))
  154. __ram_thread_stack$$Limit = .;
  155. }> RAM
  156. .ram.endof ALIGN(.,512) :
  157. {
  158. __ddsc_RAM_END = .;
  159. }> RAM
  160. __flash_readonly$$ :
  161. {
  162. __flash_readonly$$Base = .;
  163. /* section.flash.readonly */
  164. *(.flash)
  165. /* section.flash.code */
  166. *(.flash_code)
  167. *(.text*)
  168. *(.rodata*)
  169. KEEP(*(.mcuboot_sce9_key))
  170. KEEP(*(.version))
  171. __flash_readonly$$Limit = .;
  172. }> FLASH
  173. __flash_ctor$$ :
  174. {
  175. *crtbegin.o(.ctors)
  176. *crtbegin?.o(.ctors)
  177. EXCLUDE_FILE (*crtend?.o *crtend.o) *(.ctors)
  178. *(SORT(.ctors.*))
  179. *(.ctors)
  180. *crtbegin.o(.dtors)
  181. *crtbegin?.o(.dtors)
  182. EXCLUDE_FILE (*crtend?.o *crtend.o) *(.dtors)
  183. *(SORT(.dtors.*))
  184. *(.dtors)
  185. }> FLASH
  186. __flash_preinit_array$$ :
  187. {
  188. __preinit_array_start = .;
  189. KEEP(*(.preinit_array))
  190. __preinit_array_end = .;
  191. }> FLASH
  192. __flash_.got$$ :
  193. {
  194. *(.got.plt)
  195. *(.got)
  196. }> FLASH
  197. __flash_init_array$$ :
  198. {
  199. __init_array_start = .;
  200. KEEP(*(SORT(.init_array.*)))
  201. KEEP(*(.init_array))
  202. __init_array_end = .;
  203. }> FLASH
  204. __flash_fini_array$$ :
  205. {
  206. __fini_array_start = .;
  207. KEEP(*(SORT(.fini_array.*)))
  208. KEEP(*(.fini_array))
  209. __fini_array_end = .;
  210. }> FLASH
  211. /* Discard exception tables */
  212. /DISCARD/ :
  213. {
  214. *(.ARM.extab*)
  215. *(.gnu.linkonce.armextab.*)
  216. *(.ARM.exidx*)
  217. *(.gnu.linkonce.armexidx.*)
  218. }> FLASH
  219. /* Dummy section to hold required exidx labels */
  220. __flash_arm.exidx$$ :
  221. {
  222. __exidx_start = .;
  223. __exidx_end = .;
  224. }> FLASH
  225. .flash.endof ALIGN(.,512) :
  226. {
  227. __ddsc_FLASH_END = .;
  228. }> FLASH
  229. /***** OPTION_SETTING_OFS0 memory section allocations ******/
  230. .option_setting_ofs0.startof :
  231. {
  232. __ddsc_OPTION_SETTING_OFS0_START = .;
  233. }> OPTION_SETTING_OFS0
  234. /* Option Function Select Register 0 */
  235. __option_setting_ofs0_reg$$ :
  236. {
  237. __option_setting_ofs0_reg$$Base = .;
  238. KEEP(*(.option_setting_ofs0))
  239. __option_setting_ofs0_reg$$Limit = .;
  240. }> OPTION_SETTING_OFS0
  241. .option_setting_ofs0.endof :
  242. {
  243. __ddsc_OPTION_SETTING_OFS0_END = .;
  244. }> OPTION_SETTING_OFS0
  245. /***** OPTION_SETTING_OFS1 memory section allocations ******/
  246. .option_setting_ofs1.startof :
  247. {
  248. __ddsc_OPTION_SETTING_OFS1_START = .;
  249. }> OPTION_SETTING_OFS1
  250. /* Option Function Select Register 1 */
  251. __option_setting_ofs1_reg$$ :
  252. {
  253. __option_setting_ofs1_reg$$Base = .;
  254. KEEP(*(.option_setting_ofs1))
  255. __option_setting_ofs1_reg$$Limit = .;
  256. }> OPTION_SETTING_OFS1
  257. .option_setting_ofs1.endof :
  258. {
  259. __ddsc_OPTION_SETTING_OFS1_END = .;
  260. }> OPTION_SETTING_OFS1
  261. /***** OPTION_SETTING_SECMPU memory section allocations ******/
  262. .option_setting_secmpu.startof :
  263. {
  264. __ddsc_OPTION_SETTING_SECMPU_START = .;
  265. }> OPTION_SETTING_SECMPU
  266. /* Security MPU Registers */
  267. __option_setting_secmpu_reg$$ :
  268. {
  269. __option_setting_secmpu_reg$$Base = .;
  270. KEEP(*(.option_setting_secmpu))
  271. __option_setting_secmpu_reg$$Limit = .;
  272. }> OPTION_SETTING_SECMPU
  273. .option_setting_secmpu.endof :
  274. {
  275. __ddsc_OPTION_SETTING_SECMPU_END = .;
  276. }> OPTION_SETTING_SECMPU
  277. /***** OPTION_SETTING_OSIS memory section allocations ******/
  278. .option_setting_osis.startof :
  279. {
  280. __ddsc_OPTION_SETTING_OSIS_START = .;
  281. }> OPTION_SETTING_OSIS
  282. /* OCD/Serial Programmer ID setting register */
  283. __option_setting_osis_reg$$ :
  284. {
  285. __option_setting_osis_reg$$Base = .;
  286. KEEP(*(.option_setting_osis))
  287. __option_setting_osis_reg$$Limit = .;
  288. }> OPTION_SETTING_OSIS
  289. .option_setting_osis.endof :
  290. {
  291. __ddsc_OPTION_SETTING_OSIS_END = .;
  292. }> OPTION_SETTING_OSIS
  293. }