nodemcu.ld 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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 = 0xD0000
  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. .text : ALIGN(4)
  67. {
  68. _stext = .;
  69. _text_start = ABSOLUTE(.);
  70. *(.UserEnter.text)
  71. . = ALIGN(16);
  72. *(.DebugExceptionVector.text)
  73. . = ALIGN(16);
  74. *(.NMIExceptionVector.text)
  75. . = ALIGN(16);
  76. *(.KernelExceptionVector.text)
  77. LONG(0)
  78. LONG(0)
  79. LONG(0)
  80. LONG(0)
  81. . = ALIGN(16);
  82. *(.UserExceptionVector.text)
  83. LONG(0)
  84. LONG(0)
  85. LONG(0)
  86. LONG(0)
  87. . = ALIGN(16);
  88. *(.DoubleExceptionVector.text)
  89. LONG(0)
  90. LONG(0)
  91. LONG(0)
  92. LONG(0)
  93. . = ALIGN (16);
  94. *(.entry.text)
  95. *(.init.literal)
  96. *(.init)
  97. *sdk/esp_iot_sdk_*lib/lib*.a:*(.literal .text)
  98. *(.iram.text .iram0.text)
  99. *(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
  100. *(.fini.literal)
  101. *(.fini)
  102. *(.gnu.version)
  103. _text_end = ABSOLUTE(.);
  104. _etext = .;
  105. } >iram1_0_seg :iram1_0_phdr
  106. .data : ALIGN(4)
  107. {
  108. _data_start = ABSOLUTE(.);
  109. *(.data)
  110. *(.data.*)
  111. *(.gnu.linkonce.d.*)
  112. *(.data1)
  113. *(.sdata)
  114. *(.sdata.*)
  115. *(.gnu.linkonce.s.*)
  116. *(.sdata2)
  117. *(.sdata2.*)
  118. *(.gnu.linkonce.s2.*)
  119. *(.jcr)
  120. _data_end = ABSOLUTE(.);
  121. } >dram0_0_seg :dram0_0_phdr
  122. .rodata : ALIGN(4)
  123. {
  124. _rodata_start = ABSOLUTE(.);
  125. *(.rodata.dram .rodata.dram*)
  126. *(.gnu.linkonce.r.*)
  127. __XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
  128. *(.xt_except_table)
  129. *(.gcc_except_table)
  130. *(.gnu.linkonce.e.*)
  131. *(.gnu.version_r)
  132. *(.eh_frame)
  133. /* C++ constructor and destructor tables, properly ordered: */
  134. KEEP (*crtbegin.o(.ctors))
  135. KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
  136. KEEP (*(SORT(.ctors.*)))
  137. KEEP (*(.ctors))
  138. KEEP (*crtbegin.o(.dtors))
  139. KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
  140. KEEP (*(SORT(.dtors.*)))
  141. KEEP (*(.dtors))
  142. /* C++ exception handlers table: */
  143. __XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
  144. *(.xt_except_desc)
  145. *(.gnu.linkonce.h.*)
  146. __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
  147. *(.xt_except_desc_end)
  148. *(.dynamic)
  149. *(.gnu.version_d)
  150. . = ALIGN(4); /* this table MUST be 4-byte aligned */
  151. _bss_table_start = ABSOLUTE(.);
  152. LONG(_bss_start)
  153. LONG(_bss_end)
  154. _bss_table_end = ABSOLUTE(.);
  155. _rodata_end = ABSOLUTE(.);
  156. } >dram0_0_seg :dram0_0_phdr
  157. .bss ALIGN(8) (NOLOAD) : ALIGN(4)
  158. {
  159. . = ALIGN (8);
  160. _bss_start = ABSOLUTE(.);
  161. *(.dynsbss)
  162. *(.sbss)
  163. *(.sbss.*)
  164. *(.gnu.linkonce.sb.*)
  165. *(.scommon)
  166. *(.sbss2)
  167. *(.sbss2.*)
  168. *(.gnu.linkonce.sb2.*)
  169. *(.dynbss)
  170. *(.bss)
  171. *(.bss.*)
  172. *(.gnu.linkonce.b.*)
  173. *(COMMON)
  174. . = ALIGN (8);
  175. _bss_end = ABSOLUTE(.);
  176. _heap_start = ABSOLUTE(.);
  177. /* _stack_sentry = ALIGN(0x8); */
  178. } >dram0_0_seg :dram0_0_bss_phdr
  179. /* __stack = 0x3ffc8000; */
  180. .lit4 : ALIGN(4)
  181. {
  182. _lit4_start = ABSOLUTE(.);
  183. *(*.lit4)
  184. *(.lit4.*)
  185. *(.gnu.linkonce.lit4.*)
  186. _lit4_end = ABSOLUTE(.);
  187. } >iram1_0_seg :iram1_0_phdr
  188. .irom0.text : ALIGN(0x1000)
  189. {
  190. _irom0_text_start = ABSOLUTE(.);
  191. *(.servercert.flash)
  192. *(.clientcert.flash)
  193. *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
  194. *(.literal .text .literal.* .text.*)
  195. *(.rodata*)
  196. *(.sdk.version)
  197. /* Link-time arrays containing the defs for the included modules */
  198. . = ALIGN(4);
  199. lua_libs = ABSOLUTE(.);
  200. /* Allow either empty define or defined-to-1 to include the module */
  201. KEEP(*(.lua_libs))
  202. LONG(0) LONG(0) /* Null-terminate the array */
  203. lua_rotable = ABSOLUTE(.);
  204. KEEP(*(.lua_rotable))
  205. LONG(0) LONG(0) /* Null-terminate the array */
  206. /* SDK doesn't use libc functions, and are therefore safe to put in flash */
  207. */libc.a:*.o(.text* .literal*)
  208. /* end libc functions */
  209. _irom0_text_end = ABSOLUTE(.);
  210. _flash_used_end = ABSOLUTE(.);
  211. } >irom0_0_seg :irom0_0_phdr =0xffffffff
  212. }
  213. /* get ROM code address */
  214. INCLUDE "eagle.rom.addr.v6.ld"