teensy-3-6.ld 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /*--------------------------------------------------------------------------------------------------------------------*/
  2. /* */
  3. /* Memory */
  4. /* */
  5. /*--------------------------------------------------------------------------------------------------------------------*/
  6. MEMORY {
  7. flash (rx) : ORIGIN = 0, LENGTH = 1024k
  8. sram_low (rwx) : ORIGIN = 0x1FFF0000, LENGTH = 64k
  9. sram_high (rwx) : ORIGIN = 0x20000000, LENGTH = 192k
  10. }
  11. /*--------------------------------------------------------------------------------------------------------------------*/
  12. /* */
  13. /* Discarded sections */
  14. /* */
  15. /*--------------------------------------------------------------------------------------------------------------------*/
  16. SECTIONS {
  17. /DISCARD/ : {
  18. *(.gnu.*) ;
  19. *(.glue_7t);
  20. *(.glue_7);
  21. *(.ARM.*);
  22. *(.comment);
  23. *(.debug_frame);
  24. *(.vfp11_veneer);
  25. *(.v4_bx);
  26. *(.iplt);
  27. *(.rel.*);
  28. *(.igot.plt);
  29. *(rel.ARM.*);
  30. }
  31. }
  32. /*--------------------------------------------------------------------------------------------------------------------*/
  33. /* */
  34. /* Code */
  35. /* */
  36. /*--------------------------------------------------------------------------------------------------------------------*/
  37. SECTIONS {
  38. .text : {
  39. /*-------------------- Vectors */
  40. __vectors_start = . ;
  41. KEEP (*(isr.vectors)) ;
  42. __vectors_end = . ;
  43. /*-------------------- Flash magic values */
  44. LONG (-1) ;
  45. LONG (-1) ;
  46. LONG (-1) ;
  47. LONG (-2) ;
  48. /*-------------------- Code */
  49. __code_start = . ;
  50. . = ALIGN(4) ;
  51. *(.text*) ;
  52. *(.text) ;
  53. *(text) ;
  54. /*-------------------- Boot routine array */
  55. . = ALIGN (4) ;
  56. __boot_routine_array_start = . ;
  57. KEEP (*(boot.routine.array)) ;
  58. . = ALIGN (4) ;
  59. __boot_routine_array_end = . ;
  60. /*-------------------- Global C++ object constructor call */
  61. . = ALIGN (4) ;
  62. __constructor_array_start = . ;
  63. KEEP (*(.init_array)) ;
  64. . = ALIGN (4) ;
  65. __constructor_array_end = . ;
  66. /*-------------------- Init routine array */
  67. . = ALIGN (4) ;
  68. __init_routine_array_start = . ;
  69. KEEP (*(init.routine.array)) ;
  70. . = ALIGN (4) ;
  71. __init_routine_array_end = . ;
  72. /*-------------------- Real time interrupt routine array */
  73. . = ALIGN (4) ;
  74. __real_time_interrupt_routine_array_start = . ;
  75. KEEP (*(real.time.interrupt.routine.array)) ;
  76. . = ALIGN (4) ;
  77. __real_time_interrupt_routine_array_end = . ;
  78. /*-------------------- ROM data */
  79. . = ALIGN(4);
  80. *(.rodata*);
  81. . = ALIGN(4);
  82. /*-------------------- End */
  83. __code_end = . ;
  84. } > flash
  85. }
  86. /*--------------------------------------------------------------------------------------------------------------------*/
  87. /* */
  88. /* BSS (uninitialized data) */
  89. /* */
  90. /*--------------------------------------------------------------------------------------------------------------------*/
  91. SECTIONS {
  92. .bss : {
  93. . = ALIGN(4);
  94. __bss_start = . ;
  95. * (.bss*) ;
  96. . = ALIGN(4);
  97. * (COMMON) ;
  98. . = ALIGN(4);
  99. __bss_end = . ;
  100. } > sram_low
  101. }
  102. /*--------------------------------------------------------------------------------------------------------------------*/
  103. /* */
  104. /* Data (initialized data) */
  105. /* */
  106. /*--------------------------------------------------------------------------------------------------------------------*/
  107. SECTIONS {
  108. .data : AT (__code_end) {
  109. . = ALIGN (4) ;
  110. __data_start = . ;
  111. * (.data*) ;
  112. /*-------------------- Teensy CAN 0 receive ports */
  113. . = ALIGN (4) ;
  114. __teensy_can0_receive_ports_array_start = . ;
  115. * (teensy.CAN0.receive.ports.section) ;
  116. . = ALIGN (4) ;
  117. __teensy_can0_receive_ports_array_end = . ;
  118. /*-------------------- Teensy CAN 1 receive ports */
  119. . = ALIGN (4) ;
  120. __teensy_can1_receive_ports_array_start = . ;
  121. * (teensy.CAN1.receive.ports.section) ;
  122. . = ALIGN (4) ;
  123. __teensy_can1_receive_ports_array_end = . ;
  124. . = ALIGN (4) ;
  125. __data_end = . ;
  126. } > sram_low
  127. }
  128. /*--------------------------------------------------------------------------------------------------------------------*/
  129. __data_load_start = LOADADDR (.data) ;
  130. __data_load_end = LOADADDR (.data) + SIZEOF (.data) ;
  131. /*--------------------------------------------------------------------------------------------------------------------*/
  132. /* */
  133. /* System stack */
  134. /* */
  135. /*--------------------------------------------------------------------------------------------------------------------*/
  136. SECTIONS {
  137. .system_stack :{
  138. . = ALIGN (8) ;
  139. __system_stack_start = . ;
  140. . += 1024 ;
  141. . = ALIGN (4) ;
  142. __system_stack_end = . ;
  143. } > sram_low
  144. }
  145. /*--------------------------------------------------------------------------------------------------------------------*/
  146. /* */
  147. /* Heap */
  148. /* */
  149. /*--------------------------------------------------------------------------------------------------------------------*/
  150. __heap_start = ORIGIN (sram_high) ;
  151. __heap_end = ORIGIN(sram_high) + LENGTH(sram_high) ;
  152. /*--------------------------------------------------------------------------------------------------------------------*/