nodemcu.ld 6.7 KB

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