nodemcu.ld 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. /* This linker script generated from xt-genldscripts.tpp for LSP . */
  2. /* Linker Script for ld -N */
  3. MEMORY
  4. {
  5. dport0_0_seg : org = 0x3FF00000, len = 0x10
  6. dram0_0_seg : org = 0x3FFE8000, len = 0x14000
  7. iram1_0_seg : org = 0x40100000, len = 0x8000
  8. irom0_0_seg : org = 0x40210000, len = 0x80000
  9. }
  10. PHDRS
  11. {
  12. dport0_0_phdr PT_LOAD;
  13. dram0_0_phdr PT_LOAD;
  14. dram0_0_bss_phdr PT_LOAD;
  15. iram1_0_phdr PT_LOAD;
  16. irom0_0_phdr PT_LOAD;
  17. }
  18. /* Default entry point: */
  19. ENTRY(user_start_trampoline)
  20. EXTERN(_DebugExceptionVector)
  21. EXTERN(_DoubleExceptionVector)
  22. EXTERN(_KernelExceptionVector)
  23. EXTERN(_NMIExceptionVector)
  24. EXTERN(_UserExceptionVector)
  25. PROVIDE(_memmap_vecbase_reset = 0x40000000);
  26. /* Various memory-map dependent cache attribute settings: */
  27. _memmap_cacheattr_wb_base = 0x00000110;
  28. _memmap_cacheattr_wt_base = 0x00000110;
  29. _memmap_cacheattr_bp_base = 0x00000220;
  30. _memmap_cacheattr_unused_mask = 0xFFFFF00F;
  31. _memmap_cacheattr_wb_trapnull = 0x2222211F;
  32. _memmap_cacheattr_wba_trapnull = 0x2222211F;
  33. _memmap_cacheattr_wbna_trapnull = 0x2222211F;
  34. _memmap_cacheattr_wt_trapnull = 0x2222211F;
  35. _memmap_cacheattr_bp_trapnull = 0x2222222F;
  36. _memmap_cacheattr_wb_strict = 0xFFFFF11F;
  37. _memmap_cacheattr_wt_strict = 0xFFFFF11F;
  38. _memmap_cacheattr_bp_strict = 0xFFFFF22F;
  39. _memmap_cacheattr_wb_allvalid = 0x22222112;
  40. _memmap_cacheattr_wt_allvalid = 0x22222112;
  41. _memmap_cacheattr_bp_allvalid = 0x22222222;
  42. PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull);
  43. SECTIONS
  44. {
  45. .dport0.rodata : ALIGN(4)
  46. {
  47. _dport0_rodata_start = ABSOLUTE(.);
  48. *(.dport0.rodata)
  49. *(.dport.rodata)
  50. _dport0_rodata_end = ABSOLUTE(.);
  51. } >dport0_0_seg :dport0_0_phdr
  52. .dport0.literal : ALIGN(4)
  53. {
  54. _dport0_literal_start = ABSOLUTE(.);
  55. *(.dport0.literal)
  56. *(.dport.literal)
  57. _dport0_literal_end = ABSOLUTE(.);
  58. } >dport0_0_seg :dport0_0_phdr
  59. .dport0.data : ALIGN(4)
  60. {
  61. _dport0_data_start = ABSOLUTE(.);
  62. *(.dport0.data)
  63. *(.dport.data)
  64. _dport0_data_end = ABSOLUTE(.);
  65. } >dport0_0_seg :dport0_0_phdr
  66. .data : ALIGN(4)
  67. {
  68. _data_start = ABSOLUTE(.);
  69. *(.data)
  70. *(.data.*)
  71. *(.gnu.linkonce.d.*)
  72. *(.data1)
  73. *(.sdata)
  74. *(.sdata.*)
  75. *(.gnu.linkonce.s.*)
  76. *(.sdata2)
  77. *(.sdata2.*)
  78. *(.gnu.linkonce.s2.*)
  79. *(.jcr)
  80. _data_end = ABSOLUTE(.);
  81. } >dram0_0_seg :dram0_0_phdr
  82. .irom0.text : ALIGN(0x1000)
  83. {
  84. _irom0_text_start = ABSOLUTE(.);
  85. /* To be able to suppress SDK printfs, we place all SDK code first, with
  86. * a marker at the end that we can easily compare against. */
  87. */rtos-sdk/lib/lib*.a:*.o(.irom*)
  88. _irom0_sdktext_end = ABSOLUTE(.);
  89. *(.servercert.flash)
  90. *(.clientcert.flash)
  91. *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
  92. *(.literal.* .text.*)
  93. *(.rodata*)
  94. *(.sdk.version)
  95. /* Link-time arrays containing the defs for the included modules */
  96. . = ALIGN(4);
  97. lua_libs = ABSOLUTE(.);
  98. /* Allow either empty define or defined-to-1 to include the module */
  99. KEEP(*(.lua_libs))
  100. LONG(0) LONG(0) /* Null-terminate the array */
  101. lua_rotable = ABSOLUTE(.);
  102. KEEP(*(.lua_rotable))
  103. LONG(0) LONG(0) /* Null-terminate the array */
  104. _irom0_text_end = ABSOLUTE(.);
  105. _flash_used_end = ABSOLUTE(.);
  106. } >irom0_0_seg :irom0_0_phdr =0xffffffff
  107. .rodata : ALIGN(4)
  108. {
  109. _rodata_start = ABSOLUTE(.);
  110. *(.gnu.linkonce.r.*)
  111. __XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
  112. *(.xt_except_table)
  113. *(.gcc_except_table)
  114. *(.gnu.linkonce.e.*)
  115. *(.gnu.version_r)
  116. *(.eh_frame)
  117. /* C++ constructor and destructor tables, properly ordered: */
  118. __init_array_start = ABSOLUTE(.);
  119. KEEP (*crtbegin.o(.ctors))
  120. KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
  121. KEEP (*(SORT(.ctors.*)))
  122. KEEP (*(.ctors))
  123. __init_array_end = ABSOLUTE(.);
  124. KEEP (*crtbegin.o(.dtors))
  125. KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
  126. KEEP (*(SORT(.dtors.*)))
  127. KEEP (*(.dtors))
  128. /* C++ exception handlers table: */
  129. __XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
  130. *(.xt_except_desc)
  131. *(.gnu.linkonce.h.*)
  132. __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
  133. *(.xt_except_desc_end)
  134. *(.dynamic)
  135. *(.gnu.version_d)
  136. . = ALIGN(4); /* this table MUST be 4-byte aligned */
  137. _bss_table_start = ABSOLUTE(.);
  138. LONG(_bss_start)
  139. LONG(_bss_end)
  140. _bss_table_end = ABSOLUTE(.);
  141. _rodata_end = ABSOLUTE(.);
  142. } >dram0_0_seg :dram0_0_phdr
  143. .bss ALIGN(8) (NOLOAD) : ALIGN(4)
  144. {
  145. . = ALIGN (8);
  146. _bss_start = ABSOLUTE(.);
  147. *(.dynsbss)
  148. *(.sbss)
  149. *(.sbss.*)
  150. *(.gnu.linkonce.sb.*)
  151. *(.scommon)
  152. *(.sbss2)
  153. *(.sbss2.*)
  154. *(.gnu.linkonce.sb2.*)
  155. *(.dynbss)
  156. *(.bss)
  157. *(.bss.*)
  158. *(.gnu.linkonce.b.*)
  159. *(COMMON)
  160. . = ALIGN (8);
  161. _bss_end = ABSOLUTE(.);
  162. _heap_start = ABSOLUTE(.);
  163. /* _stack_sentry = ALIGN(0x8); */
  164. } >dram0_0_seg :dram0_0_bss_phdr
  165. /* __stack = 0x3ffc8000; */
  166. .text : ALIGN(4)
  167. {
  168. _stext = .;
  169. _text_start = ABSOLUTE(.);
  170. *(.UserEnter.text)
  171. . = ALIGN(16);
  172. *(.DebugExceptionVector.text)
  173. . = ALIGN(16);
  174. *(.NMIExceptionVector.text)
  175. . = ALIGN(16);
  176. *(.KernelExceptionVector.text)
  177. LONG(0)
  178. LONG(0)
  179. LONG(0)
  180. LONG(0)
  181. . = ALIGN(16);
  182. KEEP(*(.UserExceptionVectorOverride.text))
  183. . = ALIGN(16);
  184. *(.DoubleExceptionVector.text)
  185. LONG(0)
  186. LONG(0)
  187. LONG(0)
  188. LONG(0)
  189. . = ALIGN (16);
  190. KEEP(*(.UserExceptionVector.text))
  191. *(.entry.text)
  192. *(.init.literal)
  193. *(.init)
  194. *(.literal .text .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
  195. *(.iram0.text)
  196. *(.fini.literal)
  197. *(.fini)
  198. *(.gnu.version)
  199. _text_end = ABSOLUTE(.);
  200. _etext = .;
  201. } >iram1_0_seg :iram1_0_phdr
  202. .lit4 : ALIGN(4)
  203. {
  204. _lit4_start = ABSOLUTE(.);
  205. *(*.lit4)
  206. *(.lit4.*)
  207. *(.gnu.linkonce.lit4.*)
  208. _lit4_end = ABSOLUTE(.);
  209. } >iram1_0_seg :iram1_0_phdr
  210. }
  211. /* get ROM code address */
  212. INCLUDE "eagle.rom.addr.v6.ld"