Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

669 рядки
26 KiB

  1. /* Default linker script, for normal executables */
  2. OUTPUT_FORMAT("elf32-tradlittlemips")
  3. OUTPUT_ARCH(pic32mx)
  4. ENTRY(_reset)
  5. /*
  6. * Provide for a minimum stack and heap size
  7. * - _min_stack_size - represents the minimum space that must be made
  8. * available for the stack. Can be overridden from
  9. * the command line using the linker's --defsym option.
  10. * - _min_heap_size - represents the minimum space that must be made
  11. * available for the heap. Can be overridden from
  12. * the command line using the linker's --defsym option.
  13. */
  14. EXTERN (_min_stack_size _min_heap_size)
  15. PROVIDE(_min_stack_size = 0x400) ;
  16. /* PROVIDE(_min_heap_size = 0) ; Defined on the command line */
  17. INCLUDE procdefs.ld
  18. PROVIDE(_DBG_CODE_ADDR = 0xBFC02000) ;
  19. PROVIDE(_DBG_CODE_SIZE = 0xFF0) ;
  20. SECTIONS
  21. {
  22. /* Boot Sections */
  23. .reset _RESET_ADDR :
  24. {
  25. KEEP(*(.reset))
  26. /* KEEP(*(.reset.startup))*/
  27. } > kseg1_boot_mem
  28. .bev_excpt _BEV_EXCPT_ADDR :
  29. {
  30. KEEP(*(.bev_handler))
  31. } > kseg1_boot_mem
  32. .dbg_excpt _DBG_EXCPT_ADDR (NOLOAD) :
  33. {
  34. . += (DEFINED (_DEBUGGER) ? 0x8 : 0x0);
  35. } > kseg1_boot_mem
  36. .dbg_code _DBG_CODE_ADDR (NOLOAD) :
  37. {
  38. . += (DEFINED (_DEBUGGER) ? _DBG_CODE_SIZE : 0x0);
  39. } > debug_exec_mem
  40. .app_excpt _GEN_EXCPT_ADDR :
  41. {
  42. KEEP(*(.gen_handler))
  43. } > exception_mem
  44. .vector_0 _ebase_address + 0x200 :
  45. {
  46. KEEP(*(.vector_0))
  47. } > exception_mem
  48. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_0) <= (_vector_spacing << 5), "function at exception vector 0 too large")
  49. .vector_1 _ebase_address + 0x200 + (_vector_spacing << 5) * 1 :
  50. {
  51. KEEP(*(.vector_1))
  52. } > exception_mem
  53. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_1) <= (_vector_spacing << 5), "function at exception vector 1 too large")
  54. .vector_2 _ebase_address + 0x200 + (_vector_spacing << 5) * 2 :
  55. {
  56. KEEP(*(.vector_2))
  57. } > exception_mem
  58. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_2) <= (_vector_spacing << 5), "function at exception vector 2 too large")
  59. .vector_3 _ebase_address + 0x200 + (_vector_spacing << 5) * 3 :
  60. {
  61. KEEP(*(.vector_3))
  62. } > exception_mem
  63. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_3) <= (_vector_spacing << 5), "function at exception vector 3 too large")
  64. .vector_4 _ebase_address + 0x200 + (_vector_spacing << 5) * 4 :
  65. {
  66. KEEP(*(.vector_4))
  67. } > exception_mem
  68. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_4) <= (_vector_spacing << 5), "function at exception vector 4 too large")
  69. .vector_5 _ebase_address + 0x200 + (_vector_spacing << 5) * 5 :
  70. {
  71. KEEP(*(.vector_5))
  72. } > exception_mem
  73. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_5) <= (_vector_spacing << 5), "function at exception vector 5 too large")
  74. .vector_6 _ebase_address + 0x200 + (_vector_spacing << 5) * 6 :
  75. {
  76. KEEP(*(.vector_6))
  77. } > exception_mem
  78. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_6) <= (_vector_spacing << 5), "function at exception vector 6 too large")
  79. .vector_7 _ebase_address + 0x200 + (_vector_spacing << 5) * 7 :
  80. {
  81. KEEP(*(.vector_7))
  82. } > exception_mem
  83. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_7) <= (_vector_spacing << 5), "function at exception vector 7 too large")
  84. .vector_8 _ebase_address + 0x200 + (_vector_spacing << 5) * 8 :
  85. {
  86. KEEP(*(.vector_8))
  87. } > exception_mem
  88. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_8) <= (_vector_spacing << 5), "function at exception vector 8 too large")
  89. .vector_9 _ebase_address + 0x200 + (_vector_spacing << 5) * 9 :
  90. {
  91. KEEP(*(.vector_9))
  92. } > exception_mem
  93. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_9) <= (_vector_spacing << 5), "function at exception vector 9 too large")
  94. .vector_10 _ebase_address + 0x200 + (_vector_spacing << 5) * 10 :
  95. {
  96. KEEP(*(.vector_10))
  97. } > exception_mem
  98. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_10) <= (_vector_spacing << 5), "function at exception vector 10 too large")
  99. .vector_11 _ebase_address + 0x200 + (_vector_spacing << 5) * 11 :
  100. {
  101. KEEP(*(.vector_11))
  102. } > exception_mem
  103. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_11) <= (_vector_spacing << 5), "function at exception vector 11 too large")
  104. .vector_12 _ebase_address + 0x200 + (_vector_spacing << 5) * 12 :
  105. {
  106. KEEP(*(.vector_12))
  107. } > exception_mem
  108. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_12) <= (_vector_spacing << 5), "function at exception vector 12 too large")
  109. .vector_13 _ebase_address + 0x200 + (_vector_spacing << 5) * 13 :
  110. {
  111. KEEP(*(.vector_13))
  112. } > exception_mem
  113. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_13) <= (_vector_spacing << 5), "function at exception vector 13 too large")
  114. .vector_14 _ebase_address + 0x200 + (_vector_spacing << 5) * 14 :
  115. {
  116. KEEP(*(.vector_14))
  117. } > exception_mem
  118. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_14) <= (_vector_spacing << 5), "function at exception vector 14 too large")
  119. .vector_15 _ebase_address + 0x200 + (_vector_spacing << 5) * 15 :
  120. {
  121. KEEP(*(.vector_15))
  122. } > exception_mem
  123. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_15) <= (_vector_spacing << 5), "function at exception vector 15 too large")
  124. .vector_16 _ebase_address + 0x200 + (_vector_spacing << 5) * 16 :
  125. {
  126. KEEP(*(.vector_16))
  127. } > exception_mem
  128. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_16) <= (_vector_spacing << 5), "function at exception vector 16 too large")
  129. .vector_17 _ebase_address + 0x200 + (_vector_spacing << 5) * 17 :
  130. {
  131. KEEP(*(.vector_17))
  132. } > exception_mem
  133. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_17) <= (_vector_spacing << 5), "function at exception vector 17 too large")
  134. .vector_18 _ebase_address + 0x200 + (_vector_spacing << 5) * 18 :
  135. {
  136. KEEP(*(.vector_18))
  137. } > exception_mem
  138. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_18) <= (_vector_spacing << 5), "function at exception vector 18 too large")
  139. .vector_19 _ebase_address + 0x200 + (_vector_spacing << 5) * 19 :
  140. {
  141. KEEP(*(.vector_19))
  142. } > exception_mem
  143. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_19) <= (_vector_spacing << 5), "function at exception vector 19 too large")
  144. .vector_20 _ebase_address + 0x200 + (_vector_spacing << 5) * 20 :
  145. {
  146. KEEP(*(.vector_20))
  147. } > exception_mem
  148. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_20) <= (_vector_spacing << 5), "function at exception vector 20 too large")
  149. .vector_21 _ebase_address + 0x200 + (_vector_spacing << 5) * 21 :
  150. {
  151. KEEP(*(.vector_21))
  152. } > exception_mem
  153. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_21) <= (_vector_spacing << 5), "function at exception vector 21 too large")
  154. .vector_22 _ebase_address + 0x200 + (_vector_spacing << 5) * 22 :
  155. {
  156. KEEP(*(.vector_22))
  157. } > exception_mem
  158. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_22) <= (_vector_spacing << 5), "function at exception vector 22 too large")
  159. .vector_23 _ebase_address + 0x200 + (_vector_spacing << 5) * 23 :
  160. {
  161. KEEP(*(.vector_23))
  162. } > exception_mem
  163. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_23) <= (_vector_spacing << 5), "function at exception vector 23 too large")
  164. .vector_24 _ebase_address + 0x200 + (_vector_spacing << 5) * 24 :
  165. {
  166. KEEP(*(.vector_24))
  167. } > exception_mem
  168. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_24) <= (_vector_spacing << 5), "function at exception vector 24 too large")
  169. .vector_25 _ebase_address + 0x200 + (_vector_spacing << 5) * 25 :
  170. {
  171. KEEP(*(.vector_25))
  172. } > exception_mem
  173. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_25) <= (_vector_spacing << 5), "function at exception vector 25 too large")
  174. .vector_26 _ebase_address + 0x200 + (_vector_spacing << 5) * 26 :
  175. {
  176. KEEP(*(.vector_26))
  177. } > exception_mem
  178. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_26) <= (_vector_spacing << 5), "function at exception vector 26 too large")
  179. .vector_27 _ebase_address + 0x200 + (_vector_spacing << 5) * 27 :
  180. {
  181. KEEP(*(.vector_27))
  182. } > exception_mem
  183. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_27) <= (_vector_spacing << 5), "function at exception vector 27 too large")
  184. .vector_28 _ebase_address + 0x200 + (_vector_spacing << 5) * 28 :
  185. {
  186. KEEP(*(.vector_28))
  187. } > exception_mem
  188. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_28) <= (_vector_spacing << 5), "function at exception vector 28 too large")
  189. .vector_29 _ebase_address + 0x200 + (_vector_spacing << 5) * 29 :
  190. {
  191. KEEP(*(.vector_29))
  192. } > exception_mem
  193. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_29) <= (_vector_spacing << 5), "function at exception vector 29 too large")
  194. .vector_30 _ebase_address + 0x200 + (_vector_spacing << 5) * 30 :
  195. {
  196. KEEP(*(.vector_30))
  197. } > exception_mem
  198. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_30) <= (_vector_spacing << 5), "function at exception vector 30 too large")
  199. .vector_31 _ebase_address + 0x200 + (_vector_spacing << 5) * 31 :
  200. {
  201. KEEP(*(.vector_31))
  202. } > exception_mem
  203. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_31) <= (_vector_spacing << 5), "function at exception vector 31 too large")
  204. .vector_32 _ebase_address + 0x200 + (_vector_spacing << 5) * 32 :
  205. {
  206. KEEP(*(.vector_32))
  207. } > exception_mem
  208. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_32) <= (_vector_spacing << 5), "function at exception vector 32 too large")
  209. .vector_33 _ebase_address + 0x200 + (_vector_spacing << 5) * 33 :
  210. {
  211. KEEP(*(.vector_33))
  212. } > exception_mem
  213. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_33) <= (_vector_spacing << 5), "function at exception vector 33 too large")
  214. .vector_34 _ebase_address + 0x200 + (_vector_spacing << 5) * 34 :
  215. {
  216. KEEP(*(.vector_34))
  217. } > exception_mem
  218. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_34) <= (_vector_spacing << 5), "function at exception vector 34 too large")
  219. .vector_35 _ebase_address + 0x200 + (_vector_spacing << 5) * 35 :
  220. {
  221. KEEP(*(.vector_35))
  222. } > exception_mem
  223. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_35) <= (_vector_spacing << 5), "function at exception vector 35 too large")
  224. .vector_36 _ebase_address + 0x200 + (_vector_spacing << 5) * 36 :
  225. {
  226. KEEP(*(.vector_36))
  227. } > exception_mem
  228. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_36) <= (_vector_spacing << 5), "function at exception vector 36 too large")
  229. .vector_37 _ebase_address + 0x200 + (_vector_spacing << 5) * 37 :
  230. {
  231. KEEP(*(.vector_37))
  232. } > exception_mem
  233. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_37) <= (_vector_spacing << 5), "function at exception vector 37 too large")
  234. .vector_38 _ebase_address + 0x200 + (_vector_spacing << 5) * 38 :
  235. {
  236. KEEP(*(.vector_38))
  237. } > exception_mem
  238. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_38) <= (_vector_spacing << 5), "function at exception vector 38 too large")
  239. .vector_39 _ebase_address + 0x200 + (_vector_spacing << 5) * 39 :
  240. {
  241. KEEP(*(.vector_39))
  242. } > exception_mem
  243. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_39) <= (_vector_spacing << 5), "function at exception vector 39 too large")
  244. .vector_40 _ebase_address + 0x200 + (_vector_spacing << 5) * 40 :
  245. {
  246. KEEP(*(.vector_40))
  247. } > exception_mem
  248. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_40) <= (_vector_spacing << 5), "function at exception vector 40 too large")
  249. .vector_41 _ebase_address + 0x200 + (_vector_spacing << 5) * 41 :
  250. {
  251. KEEP(*(.vector_41))
  252. } > exception_mem
  253. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_41) <= (_vector_spacing << 5), "function at exception vector 41 too large")
  254. .vector_42 _ebase_address + 0x200 + (_vector_spacing << 5) * 42 :
  255. {
  256. KEEP(*(.vector_42))
  257. } > exception_mem
  258. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_42) <= (_vector_spacing << 5), "function at exception vector 42 too large")
  259. .vector_43 _ebase_address + 0x200 + (_vector_spacing << 5) * 43 :
  260. {
  261. KEEP(*(.vector_43))
  262. } > exception_mem
  263. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_43) <= (_vector_spacing << 5), "function at exception vector 43 too large")
  264. .vector_44 _ebase_address + 0x200 + (_vector_spacing << 5) * 44 :
  265. {
  266. KEEP(*(.vector_44))
  267. } > exception_mem
  268. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_44) <= (_vector_spacing << 5), "function at exception vector 44 too large")
  269. .vector_45 _ebase_address + 0x200 + (_vector_spacing << 5) * 45 :
  270. {
  271. KEEP(*(.vector_45))
  272. } > exception_mem
  273. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_45) <= (_vector_spacing << 5), "function at exception vector 45 too large")
  274. .vector_46 _ebase_address + 0x200 + (_vector_spacing << 5) * 46 :
  275. {
  276. KEEP(*(.vector_46))
  277. } > exception_mem
  278. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_46) <= (_vector_spacing << 5), "function at exception vector 46 too large")
  279. .vector_47 _ebase_address + 0x200 + (_vector_spacing << 5) * 47 :
  280. {
  281. KEEP(*(.vector_47))
  282. } > exception_mem
  283. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_47) <= (_vector_spacing << 5), "function at exception vector 47 too large")
  284. .vector_48 _ebase_address + 0x200 + (_vector_spacing << 5) * 48 :
  285. {
  286. KEEP(*(.vector_48))
  287. } > exception_mem
  288. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_48) <= (_vector_spacing << 5), "function at exception vector 48 too large")
  289. .vector_49 _ebase_address + 0x200 + (_vector_spacing << 5) * 49 :
  290. {
  291. KEEP(*(.vector_49))
  292. } > exception_mem
  293. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_49) <= (_vector_spacing << 5), "function at exception vector 49 too large")
  294. .vector_50 _ebase_address + 0x200 + (_vector_spacing << 5) * 50 :
  295. {
  296. KEEP(*(.vector_50))
  297. } > exception_mem
  298. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_50) <= (_vector_spacing << 5), "function at exception vector 50 too large")
  299. .vector_51 _ebase_address + 0x200 + (_vector_spacing << 5) * 51 :
  300. {
  301. KEEP(*(.vector_51))
  302. } > exception_mem
  303. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_51) <= (_vector_spacing << 5), "function at exception vector 51 too large")
  304. .vector_52 _ebase_address + 0x200 + (_vector_spacing << 5) * 52 :
  305. {
  306. KEEP(*(.vector_52))
  307. } > exception_mem
  308. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_52) <= (_vector_spacing << 5), "function at exception vector 52 too large")
  309. .vector_53 _ebase_address + 0x200 + (_vector_spacing << 5) * 53 :
  310. {
  311. KEEP(*(.vector_53))
  312. } > exception_mem
  313. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_53) <= (_vector_spacing << 5), "function at exception vector 53 too large")
  314. .vector_54 _ebase_address + 0x200 + (_vector_spacing << 5) * 54 :
  315. {
  316. KEEP(*(.vector_54))
  317. } > exception_mem
  318. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_54) <= (_vector_spacing << 5), "function at exception vector 54 too large")
  319. .vector_55 _ebase_address + 0x200 + (_vector_spacing << 5) * 55 :
  320. {
  321. KEEP(*(.vector_55))
  322. } > exception_mem
  323. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_55) <= (_vector_spacing << 5), "function at exception vector 55 too large")
  324. .vector_56 _ebase_address + 0x200 + (_vector_spacing << 5) * 56 :
  325. {
  326. KEEP(*(.vector_56))
  327. } > exception_mem
  328. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_56) <= (_vector_spacing << 5), "function at exception vector 56 too large")
  329. .vector_57 _ebase_address + 0x200 + (_vector_spacing << 5) * 57 :
  330. {
  331. KEEP(*(.vector_57))
  332. } > exception_mem
  333. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_57) <= (_vector_spacing << 5), "function at exception vector 57 too large")
  334. .vector_58 _ebase_address + 0x200 + (_vector_spacing << 5) * 58 :
  335. {
  336. KEEP(*(.vector_58))
  337. } > exception_mem
  338. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_58) <= (_vector_spacing << 5), "function at exception vector 58 too large")
  339. .vector_59 _ebase_address + 0x200 + (_vector_spacing << 5) * 59 :
  340. {
  341. KEEP(*(.vector_59))
  342. } > exception_mem
  343. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_59) <= (_vector_spacing << 5), "function at exception vector 59 too large")
  344. .vector_60 _ebase_address + 0x200 + (_vector_spacing << 5) * 60 :
  345. {
  346. KEEP(*(.vector_60))
  347. } > exception_mem
  348. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_60) <= (_vector_spacing << 5), "function at exception vector 60 too large")
  349. .vector_61 _ebase_address + 0x200 + (_vector_spacing << 5) * 61 :
  350. {
  351. KEEP(*(.vector_61))
  352. } > exception_mem
  353. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_61) <= (_vector_spacing << 5), "function at exception vector 61 too large")
  354. .vector_62 _ebase_address + 0x200 + (_vector_spacing << 5) * 62 :
  355. {
  356. KEEP(*(.vector_62))
  357. } > exception_mem
  358. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_62) <= (_vector_spacing << 5), "function at exception vector 62 too large")
  359. .vector_63 _ebase_address + 0x200 + (_vector_spacing << 5) * 63 :
  360. {
  361. KEEP(*(.vector_63))
  362. } > exception_mem
  363. ASSERT (_vector_spacing == 0 || SIZEOF(.vector_63) <= (_vector_spacing << 5), "function at exception vector 63 too large")
  364. /* Starting with C32 v2.00, the startup code is in the .reset.startup section.
  365. * Keep this here for backwards compatibility.
  366. */
  367. .startup ORIGIN(kseg0_boot_mem) :
  368. {
  369. KEEP(*(.startup))
  370. KEEP(*(.reset.startup))
  371. } > kseg0_boot_mem
  372. /* Code Sections - Note that input sections *(.text) and *(.text.*)
  373. ** are not mapped here. Starting in C32 v2.00, the best-fit allocator
  374. ** locates them, so that .text may flow around absolute sections
  375. ** as needed.
  376. */
  377. .text :
  378. {
  379. *(.stub .gnu.linkonce.t.*)
  380. KEEP (*(.text.*personality*))
  381. *(.mips16.fn.*)
  382. *(.mips16.call.*)
  383. *(.gnu.warning)
  384. . = ALIGN(4) ;
  385. } >kseg0_program_mem
  386. /* Global-namespace object initialization */
  387. .init :
  388. {
  389. KEEP (*crti.o(.init))
  390. KEEP (*crtbegin.o(.init))
  391. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *crtn.o ).init))
  392. KEEP (*crtend.o(.init))
  393. KEEP (*crtn.o(.init))
  394. . = ALIGN(4) ;
  395. } >kseg0_program_mem
  396. .fini :
  397. {
  398. KEEP (*(.fini))
  399. . = ALIGN(4) ;
  400. } >kseg0_program_mem
  401. .preinit_array :
  402. {
  403. PROVIDE_HIDDEN (__preinit_array_start = .);
  404. KEEP (*(.preinit_array))
  405. PROVIDE_HIDDEN (__preinit_array_end = .);
  406. . = ALIGN(4) ;
  407. } >kseg0_program_mem
  408. .init_array :
  409. {
  410. PROVIDE_HIDDEN (__init_array_start = .);
  411. KEEP (*(SORT(.init_array.*)))
  412. KEEP (*(.init_array))
  413. PROVIDE_HIDDEN (__init_array_end = .);
  414. . = ALIGN(4) ;
  415. } >kseg0_program_mem
  416. .fini_array :
  417. {
  418. PROVIDE_HIDDEN (__fini_array_start = .);
  419. KEEP (*(SORT(.fini_array.*)))
  420. KEEP (*(.fini_array))
  421. PROVIDE_HIDDEN (__fini_array_end = .);
  422. . = ALIGN(4) ;
  423. } >kseg0_program_mem
  424. .ctors :
  425. {
  426. /* XC32 uses crtbegin.o to find the start of
  427. the constructors, so we make sure it is
  428. first. Because this is a wildcard, it
  429. doesn't matter if the user does not
  430. actually link against crtbegin.o; the
  431. linker won't look for a file to match a
  432. wildcard. The wildcard also means that it
  433. doesn't matter which directory crtbegin.o
  434. is in. */
  435. KEEP (*crtbegin.o(.ctors))
  436. KEEP (*crtbegin?.o(.ctors))
  437. /* We don't want to include the .ctor section from
  438. the crtend.o file until after the sorted ctors.
  439. The .ctor section from the crtend file contains the
  440. end of ctors marker and it must be last */
  441. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  442. KEEP (*(SORT(.ctors.*)))
  443. KEEP (*(.ctors))
  444. . = ALIGN(4) ;
  445. } >kseg0_program_mem
  446. .dtors :
  447. {
  448. KEEP (*crtbegin.o(.dtors))
  449. KEEP (*crtbegin?.o(.dtors))
  450. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  451. KEEP (*(SORT(.dtors.*)))
  452. KEEP (*(.dtors))
  453. . = ALIGN(4) ;
  454. } >kseg0_program_mem
  455. /* Read-only sections */
  456. .rodata :
  457. {
  458. *( .gnu.linkonce.r.*)
  459. *(.rodata1)
  460. . = ALIGN(4) ;
  461. } >kseg0_program_mem
  462. /*
  463. * Small initialized constant global and static data can be placed in the
  464. * .sdata2 section. This is different from .sdata, which contains small
  465. * initialized non-constant global and static data.
  466. */
  467. .sdata2 ALIGN(4) :
  468. {
  469. *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
  470. . = ALIGN(4) ;
  471. } >kseg0_program_mem
  472. /*
  473. * Uninitialized constant global and static data (i.e., variables which will
  474. * always be zero). Again, this is different from .sbss, which contains
  475. * small non-initialized, non-constant global and static data.
  476. */
  477. .sbss2 ALIGN(4) :
  478. {
  479. *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
  480. . = ALIGN(4) ;
  481. } >kseg0_program_mem
  482. .eh_frame_hdr :
  483. {
  484. *(.eh_frame_hdr)
  485. } >kseg0_program_mem
  486. . = ALIGN(4) ;
  487. .eh_frame : ONLY_IF_RO
  488. {
  489. KEEP (*(.eh_frame))
  490. } >kseg0_program_mem
  491. . = ALIGN(4) ;
  492. .gcc_except_table : ONLY_IF_RO
  493. {
  494. *(.gcc_except_table .gcc_except_table.*)
  495. } >kseg0_program_mem
  496. . = ALIGN(4) ;
  497. .dbg_data (NOLOAD) :
  498. {
  499. . += (DEFINED (_DEBUGGER) ? 0x200 : 0x0);
  500. } >kseg1_data_mem
  501. .jcr :
  502. {
  503. KEEP (*(.jcr))
  504. . = ALIGN(4) ;
  505. } >kseg1_data_mem
  506. .eh_frame : ONLY_IF_RW
  507. {
  508. KEEP (*(.eh_frame))
  509. } >kseg1_data_mem
  510. . = ALIGN(4) ;
  511. .gcc_except_table : ONLY_IF_RW
  512. {
  513. *(.gcc_except_table .gcc_except_table.*)
  514. } >kseg1_data_mem
  515. . = ALIGN(4) ;
  516. /* Persistent data - Use the new C 'persistent' attribute instead. */
  517. .persist :
  518. {
  519. _persist_begin = .;
  520. *(.persist .persist.*)
  521. *(.pbss .pbss.*)
  522. . = ALIGN(4) ;
  523. _persist_end = .;
  524. } >kseg1_data_mem
  525. /*
  526. * Note that input sections named .data* are no longer mapped here.
  527. * Starting in C32 v2.00, the best-fit allocator locates them, so
  528. * that they may flow around absolute sections as needed.
  529. */
  530. .data :
  531. {
  532. *( .gnu.linkonce.d.*)
  533. SORT(CONSTRUCTORS)
  534. *(.data1)
  535. . = ALIGN(4) ;
  536. } >kseg1_data_mem
  537. . = .;
  538. _gp = ALIGN(16) + 0x7ff0;
  539. .got ALIGN(4) :
  540. {
  541. *(.got.plt) *(.got)
  542. . = ALIGN(4) ;
  543. } >kseg1_data_mem /* AT>kseg0_program_mem */
  544. /*
  545. * Note that "small" data sections are still mapped in the linker
  546. * script. This ensures that they are grouped together for
  547. * gp-relative addressing. Absolute sections are allocated after
  548. * the "small" data sections so small data cannot flow around them.
  549. */
  550. /*
  551. * We want the small data sections together, so single-instruction offsets
  552. * can access them all, and initialized data all before uninitialized, so
  553. * we can shorten the on-disk segment size.
  554. */
  555. .sdata ALIGN(4) :
  556. {
  557. _sdata_begin = . ;
  558. *(.sdata .sdata.* .gnu.linkonce.s.*)
  559. . = ALIGN(4) ;
  560. _sdata_end = . ;
  561. } >kseg1_data_mem
  562. .lit8 :
  563. {
  564. *(.lit8)
  565. } >kseg1_data_mem
  566. .lit4 :
  567. {
  568. *(.lit4)
  569. } >kseg1_data_mem
  570. . = ALIGN (4) ;
  571. _data_end = . ;
  572. _bss_begin = . ;
  573. .sbss ALIGN(4) :
  574. {
  575. _sbss_begin = . ;
  576. *(.dynsbss)
  577. *(.sbss .sbss.* .gnu.linkonce.sb.*)
  578. *(.scommon)
  579. _sbss_end = . ;
  580. . = ALIGN(4) ;
  581. } >kseg1_data_mem
  582. /*
  583. * Align here to ensure that the .bss section occupies space up to
  584. * _end. Align after .bss to ensure correct alignment even if the
  585. * .bss section disappears because there are no input sections.
  586. *
  587. * Note that input sections named .bss* are no longer mapped here.
  588. * Starting in C32 v2.00, the best-fit allocator locates them, so
  589. * that they may flow around absolute sections as needed.
  590. *
  591. */
  592. .bss :
  593. {
  594. *(.dynbss)
  595. *(COMMON)
  596. /* Align here to ensure that the .bss section occupies space up to
  597. _end. Align after .bss to ensure correct alignment even if the
  598. .bss section disappears because there are no input sections. */
  599. . = ALIGN(. != 0 ? 4 : 1);
  600. } >kseg1_data_mem
  601. . = ALIGN(4) ;
  602. _end = . ;
  603. _bss_end = . ;
  604. /* Starting with C32 v2.00, the heap and stack are dynamically
  605. * allocated by the linker.
  606. */
  607. /*
  608. * RAM functions go at the end of our stack and heap allocation.
  609. * Alignment of 2K required by the boundary register (BMXDKPBA).
  610. *
  611. * RAM functions are now allocated by the linker. The linker generates
  612. * _ramfunc_begin and _bmxdkpba_address symbols depending on the
  613. * location of RAM functions.
  614. */
  615. _bmxdudba_address = LENGTH(kseg1_data_mem) ;
  616. _bmxdupba_address = LENGTH(kseg1_data_mem) ;
  617. /* The .pdr section belongs in the absolute section */
  618. /DISCARD/ : { *(.pdr) }
  619. .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  620. .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  621. .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
  622. .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
  623. .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
  624. .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
  625. .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
  626. .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
  627. .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
  628. .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
  629. /* Stabs debugging sections. */
  630. .stab 0 : { *(.stab) }
  631. .stabstr 0 : { *(.stabstr) }
  632. .stab.excl 0 : { *(.stab.excl) }
  633. .stab.exclstr 0 : { *(.stab.exclstr) }
  634. .stab.index 0 : { *(.stab.index) }
  635. .stab.indexstr 0 : { *(.stab.indexstr) }
  636. .comment 0 : { *(.comment) }
  637. /* DWARF debug sections.
  638. Symbols in the DWARF debugging sections are relative to the beginning
  639. of the section so we begin them at 0. */
  640. /* DWARF 1 */
  641. .debug 0 : { *(.debug) }
  642. .line 0 : { *(.line) }
  643. /* GNU DWARF 1 extensions */
  644. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  645. .debug_sfnames 0 : { *(.debug_sfnames) }
  646. /* DWARF 1.1 and DWARF 2 */
  647. .debug_aranges 0 : { *(.debug_aranges) }
  648. .debug_pubnames 0 : { *(.debug_pubnames) }
  649. /* DWARF 2 */
  650. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  651. .debug_abbrev 0 : { *(.debug_abbrev) }
  652. .debug_line 0 : { *(.debug_line) }
  653. .debug_frame 0 : { *(.debug_frame) }
  654. .debug_str 0 : { *(.debug_str) }
  655. .debug_loc 0 : { *(.debug_loc) }
  656. .debug_macinfo 0 : { *(.debug_macinfo) }
  657. /* SGI/MIPS DWARF 2 extensions */
  658. .debug_weaknames 0 : { *(.debug_weaknames) }
  659. .debug_funcnames 0 : { *(.debug_funcnames) }
  660. .debug_typenames 0 : { *(.debug_typenames) }
  661. .debug_varnames 0 : { *(.debug_varnames) }
  662. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  663. .debug_ranges 0 : { *(.debug_ranges) }
  664. /DISCARD/ : { *(.rel.dyn) }
  665. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  666. /DISCARD/ : { *(.note.GNU-stack) }
  667. /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.discard) }
  668. }