nodemcu.ld 5.8 KB

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