nodemcu.ld 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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. iram0_0_seg : org = 0x4010E000, len = 0x2000
  9. irom0_0_seg : org = 0x40210000, len = 0xE0000
  10. }
  11. PHDRS
  12. {
  13. dport0_0_phdr PT_LOAD;
  14. dram0_0_phdr PT_LOAD;
  15. dram0_0_bss_phdr PT_LOAD;
  16. iram1_0_phdr PT_LOAD;
  17. iram0_0_phdr PT_LOAD;
  18. irom0_0_phdr PT_LOAD;
  19. }
  20. /* Default entry point: */
  21. ENTRY(call_user_start)
  22. EXTERN(_DebugExceptionVector)
  23. EXTERN(_DoubleExceptionVector)
  24. EXTERN(_KernelExceptionVector)
  25. EXTERN(_NMIExceptionVector)
  26. EXTERN(_UserExceptionVector)
  27. PROVIDE(_memmap_vecbase_reset = 0x40000000);
  28. /* Various memory-map dependent cache attribute settings: */
  29. _memmap_cacheattr_wb_base = 0x00000110;
  30. _memmap_cacheattr_wt_base = 0x00000110;
  31. _memmap_cacheattr_bp_base = 0x00000220;
  32. _memmap_cacheattr_unused_mask = 0xFFFFF00F;
  33. _memmap_cacheattr_wb_trapnull = 0x2222211F;
  34. _memmap_cacheattr_wba_trapnull = 0x2222211F;
  35. _memmap_cacheattr_wbna_trapnull = 0x2222211F;
  36. _memmap_cacheattr_wt_trapnull = 0x2222211F;
  37. _memmap_cacheattr_bp_trapnull = 0x2222222F;
  38. _memmap_cacheattr_wb_strict = 0xFFFFF11F;
  39. _memmap_cacheattr_wt_strict = 0xFFFFF11F;
  40. _memmap_cacheattr_bp_strict = 0xFFFFF22F;
  41. _memmap_cacheattr_wb_allvalid = 0x22222112;
  42. _memmap_cacheattr_wt_allvalid = 0x22222112;
  43. _memmap_cacheattr_bp_allvalid = 0x22222222;
  44. PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull);
  45. SECTIONS
  46. {
  47. .dport0.rodata : ALIGN(4)
  48. {
  49. _dport0_rodata_start = ABSOLUTE(.);
  50. *(.dport0.rodata)
  51. *(.dport.rodata)
  52. _dport0_rodata_end = ABSOLUTE(.);
  53. } >dport0_0_seg :dport0_0_phdr
  54. .dport0.literal : ALIGN(4)
  55. {
  56. _dport0_literal_start = ABSOLUTE(.);
  57. *(.dport0.literal)
  58. *(.dport.literal)
  59. _dport0_literal_end = ABSOLUTE(.);
  60. } >dport0_0_seg :dport0_0_phdr
  61. .dport0.data : ALIGN(4)
  62. {
  63. _dport0_data_start = ABSOLUTE(.);
  64. *(.dport0.data)
  65. *(.dport.data)
  66. _dport0_data_end = ABSOLUTE(.);
  67. } >dport0_0_seg :dport0_0_phdr
  68. .text : ALIGN(4)
  69. {
  70. _stext = .;
  71. _text_start = ABSOLUTE(.);
  72. *(.UserEnter.text)
  73. . = ALIGN(16);
  74. *(.DebugExceptionVector.text)
  75. . = ALIGN(16);
  76. *(.NMIExceptionVector.text)
  77. . = ALIGN(16);
  78. *(.KernelExceptionVector.text)
  79. LONG(0)
  80. LONG(0)
  81. LONG(0)
  82. LONG(0)
  83. . = ALIGN(16);
  84. *(.UserExceptionVector.text)
  85. LONG(0)
  86. LONG(0)
  87. LONG(0)
  88. LONG(0)
  89. . = ALIGN(16);
  90. *(.DoubleExceptionVector.text)
  91. LONG(0)
  92. LONG(0)
  93. LONG(0)
  94. LONG(0)
  95. . = ALIGN (16);
  96. *(.entry.text)
  97. *(.init.literal)
  98. *(.init)
  99. /*
  100. * SDK libraries that used in bootup process, interruption handling
  101. * and other ways where flash cache (iROM) is unavailable:
  102. */
  103. *libmain.a:*( .literal .literal.* .text .text.*)
  104. *libphy.a:*( .literal .literal.* .text .text.*)
  105. *libpp.a:*( .literal .literal.* .text .text.*)
  106. *libgcc.a:_ashrdi3.o( .literal .literal.* .text .text.*)
  107. *libgcc.a:_divsf3.o( .literal .literal.* .text .text.*)
  108. *libgcc.a:_fixsfsi.o( .literal .literal.* .text .text.*)
  109. *libgcc.a:_modsi3.o( .literal .literal.* .text .text.*)
  110. *libnet80211.a:*( .literal .text )
  111. /*
  112. * The following SDK libraries have .literal and .text sections, but are
  113. * either not used in NodeMCU or are safe to execute out of in iROM:
  114. * libat.a libcrypto.a libdriver.a libnet80211.a libespnow.a
  115. * liblwip_536.a ibpwm.a libwpa.a ibwps.a
  116. */
  117. *(.iram.text .iram0.text .iram0.text.*)
  118. *(.iram0.data.*)
  119. *(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
  120. *(.fini.literal)
  121. *(.fini)
  122. *(.gnu.version)
  123. _text_end = ABSOLUTE(.);
  124. _etext = .;
  125. } >iram1_0_seg :iram1_0_phdr
  126. .data : ALIGN(4)
  127. {
  128. _data_start = ABSOLUTE(.);
  129. *(.data)
  130. *(.data.*)
  131. *(.gnu.linkonce.d.*)
  132. *(.data1)
  133. *(.sdata)
  134. *(.sdata.*)
  135. *(.gnu.linkonce.s.*)
  136. *(.sdata2)
  137. *(.sdata2.*)
  138. *(.gnu.linkonce.s2.*)
  139. *(.jcr)
  140. _data_end = ABSOLUTE(.);
  141. } >dram0_0_seg :dram0_0_phdr
  142. .rodata : ALIGN(4)
  143. {
  144. _rodata_start = ABSOLUTE(.);
  145. *(.rodata.dram .rodata.dram*)
  146. *(.gnu.linkonce.r.*)
  147. __XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
  148. *(.xt_except_table)
  149. *(.gcc_except_table)
  150. *(.gnu.linkonce.e.*)
  151. *(.gnu.version_r)
  152. *(.eh_frame)
  153. /* C++ constructor and destructor tables, properly ordered: */
  154. KEEP (*crtbegin.o(.ctors))
  155. KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
  156. KEEP (*(SORT(.ctors.*)))
  157. KEEP (*(.ctors))
  158. KEEP (*crtbegin.o(.dtors))
  159. KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
  160. KEEP (*(SORT(.dtors.*)))
  161. KEEP (*(.dtors))
  162. /* C++ exception handlers table: */
  163. __XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
  164. *(.xt_except_desc)
  165. *(.gnu.linkonce.h.*)
  166. __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
  167. *(.xt_except_desc_end)
  168. *(.dynamic)
  169. *(.gnu.version_d)
  170. . = ALIGN(4); /* this table MUST be 4-byte aligned */
  171. _bss_table_start = ABSOLUTE(.);
  172. LONG(_bss_start)
  173. LONG(_bss_end)
  174. _bss_table_end = ABSOLUTE(.);
  175. _rodata_end = ABSOLUTE(.);
  176. } >dram0_0_seg :dram0_0_phdr
  177. .bss ALIGN(8) (NOLOAD) : ALIGN(4)
  178. {
  179. . = ALIGN (8);
  180. _bss_start = ABSOLUTE(.);
  181. *(.dynsbss)
  182. *(.sbss)
  183. *(.sbss.*)
  184. *(.gnu.linkonce.sb.*)
  185. *(.scommon)
  186. *(.sbss2)
  187. *(.sbss2.*)
  188. *(.gnu.linkonce.sb2.*)
  189. *(.dynbss)
  190. *(.bss)
  191. *(.bss.*)
  192. *(.gnu.linkonce.b.*)
  193. *(COMMON)
  194. . = ALIGN (8);
  195. _bss_end = ABSOLUTE(.);
  196. *(.noinit)
  197. _heap_start = ABSOLUTE(.);
  198. /* _stack_sentry = ALIGN(0x8); */
  199. } >dram0_0_seg :dram0_0_bss_phdr
  200. /* __stack = 0x3ffc8000; */
  201. .lit4 : ALIGN(4)
  202. {
  203. _lit4_start = ABSOLUTE(.);
  204. *(*.lit4)
  205. *(.lit4.*)
  206. *(.gnu.linkonce.lit4.*)
  207. _lit4_end = ABSOLUTE(.);
  208. } >iram1_0_seg :iram1_0_phdr
  209. .pre_init_ram : ALIGN(0x1000)
  210. {
  211. _iram0_start = ABSOLUTE(.);
  212. *(*.pre_init)
  213. _iram0_end = ABSOLUTE(.);
  214. } >iram0_0_seg :iram0_0_phdr
  215. .irom0.text : ALIGN(0x1000)
  216. {
  217. _irom0_text_start = ABSOLUTE(.);
  218. KEEP(*(.irom0.ptable))
  219. . = ALIGN(0x1000);
  220. *(.servercert.flash)
  221. *(.clientcert.flash)
  222. . = ALIGN(0x1000);
  223. *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
  224. *(.literal .text .literal.* .text.*)
  225. *(.rodata*)
  226. *(.sdk.version)
  227. /* Link-time arrays containing the defs for the included modules */
  228. . = ALIGN(8);
  229. lua_libs_base = ABSOLUTE(.);
  230. /* Allow either empty define or defined-to-1 to include the module */
  231. KEEP(*(.lua_libs))
  232. *liblua.a:linit.o(.lua_libs)
  233. *(.lua_libs)
  234. LONG(0) LONG(0) /* Null-terminate the array */
  235. lua_rotable_base = ABSOLUTE(.);
  236. KEEP(*(.lua_rotable))
  237. LONG(0) LONG(0) /* Null-terminate the array */
  238. /* SDK doesn't use libc functions, and are therefore safe to put in flash */
  239. */libc.a:*.o(.text* .literal*)
  240. /* end libc functions */
  241. /* Reserved areas, flash page aligned and last */
  242. . = ALIGN(4096);
  243. _irom0_text_end = ABSOLUTE(.);
  244. _flash_used_end = ABSOLUTE(.);
  245. } >irom0_0_seg :irom0_0_phdr =0xffffffff
  246. }
  247. /* get ROM code address */
  248. INCLUDE "eagle.rom.addr.v6.ld"