local.eagle.app.v6.common.ld 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. /* This linker script generated from xt-genldscripts.tpp for LSP . */
  2. /* Linker Script for ld -N */
  3. /* The restriction to one MEMORY command, appears to be a restriction in
  4. past versions. https://stackoverflow.com/a/55673816
  5. This 2nd MEMORY command appears to work fine.
  6. */
  7. MEMORY
  8. {
  9. iram1_0_seg : org = 0x40100000, len = 0x8000
  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. irom0_0_phdr PT_LOAD;
  18. }
  19. /* Default entry point: */
  20. ENTRY(app_entry)
  21. EXTERN(_DebugExceptionVector)
  22. EXTERN(_DoubleExceptionVector)
  23. EXTERN(_KernelExceptionVector)
  24. EXTERN(_NMIExceptionVector)
  25. EXTERN(_UserExceptionVector)
  26. EXTERN(core_version)
  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. .data : ALIGN(4)
  69. {
  70. _data_start = ABSOLUTE(.);
  71. *(.data)
  72. *(.data.*)
  73. *(.gnu.linkonce.d.*)
  74. *(.data1)
  75. *(.sdata)
  76. *(.sdata.*)
  77. *(.gnu.linkonce.s.*)
  78. *(.sdata2)
  79. *(.sdata2.*)
  80. *(.gnu.linkonce.s2.*)
  81. *(.jcr)
  82. . = ALIGN(4);
  83. _Pri_3_HandlerAddress = ABSOLUTE(.);
  84. _data_end = ABSOLUTE(.);
  85. } >dram0_0_seg :dram0_0_phdr
  86. .noinit : ALIGN(4)
  87. {
  88. *(.noinit)
  89. } >dram0_0_seg :dram0_0_phdr
  90. /* IRAM is split into .text and .text1 to allow for moving specific */
  91. /* functions into IRAM that would be matched by the irom0.text matcher */
  92. .text : ALIGN(4)
  93. {
  94. _stext = .;
  95. _text_start = ABSOLUTE(.);
  96. *(.UserEnter.text)
  97. . = ALIGN(16);
  98. *(.DebugExceptionVector.text)
  99. . = ALIGN(16);
  100. *(.NMIExceptionVector.text)
  101. . = ALIGN(16);
  102. *(.KernelExceptionVector.text)
  103. LONG(0)
  104. LONG(0)
  105. LONG(0)
  106. LONG(0)
  107. . = ALIGN(16);
  108. *(.UserExceptionVector.text)
  109. LONG(0)
  110. LONG(0)
  111. LONG(0)
  112. LONG(0)
  113. . = ALIGN(16);
  114. *(.DoubleExceptionVector.text)
  115. LONG(0)
  116. LONG(0)
  117. LONG(0)
  118. LONG(0)
  119. . = ALIGN (16);
  120. *(.entry.text)
  121. *(.init.literal)
  122. *(.init)
  123. *(.text.app_entry*) /* The main startup code */
  124. *(.text.gdbstub*, .text.gdb_init) /* Any GDB hooks */
  125. /* all functional callers are placed in IRAM (including SPI/IRQ callbacks/etc) here */
  126. *(.text._ZNKSt8functionIF*EE*) /* std::function<any(...)>::operator()() const */
  127. } >iram1_0_seg :iram1_0_phdr
  128. .irom0.text : ALIGN(4)
  129. {
  130. _irom0_text_start = ABSOLUTE(.);
  131. /* Stuff the CRC in well known symbols at a well known location */
  132. __crc_len = ABSOLUTE(.);
  133. LONG(0x00000000);
  134. __crc_val = ABSOLUTE(.);
  135. LONG(0x00000000);
  136. *(.ver_number)
  137. *.c.o(.literal*, .text*)
  138. *.cpp.o(EXCLUDE_FILE (umm_malloc.cpp.o) .literal*, EXCLUDE_FILE (umm_malloc.cpp.o) .text*)
  139. *.cc.o(.literal*, .text*)
  140. *(.rodata._ZTV*) /* C++ vtables */
  141. *libgcc.a:unwind-dw2.o(.literal .text .rodata .literal.* .text.* .rodata.*)
  142. *libgcc.a:unwind-dw2-fde.o(.literal .text .rodata .literal.* .text.* .rodata.*)
  143. *libc.a:(.literal .text .literal.* .text.*)
  144. *libm.a:(.literal .text .literal.* .text.*)
  145. *libgcc.a:_umoddi3.o(.literal .text)
  146. *libgcc.a:_udivdi3.o(.literal .text)
  147. *libgcc.a:_divsf3.o(.literal .text)
  148. *libgcc.a:_fixsfsi.o(.literal .text)
  149. *libgcc.a:_cmpdf2.o(.literal .text)
  150. *libgcc.a:_cmpsf2.o(.literal .text)
  151. *libstdc++.a:( .literal .text .literal.* .text.*)
  152. *libstdc++-exc.a:( .literal .text .literal.* .text.*)
  153. *libsmartconfig.a:(.literal .text .literal.* .text.*)
  154. *liblwip_gcc.a:(.literal .text .literal.* .text.*)
  155. *liblwip_src.a:(.literal .text .literal.* .text.*)
  156. *liblwip2-536.a:(.literal .text .literal.* .text.*)
  157. *liblwip2-1460.a:(.literal .text .literal.* .text.*)
  158. *liblwip2-536-feat.a:(.literal .text .literal.* .text.*)
  159. *liblwip2-1460-feat.a:(.literal .text .literal.* .text.*)
  160. *liblwip6-536-feat.a:(.literal .text .literal.* .text.*)
  161. *liblwip6-1460-feat.a:(.literal .text .literal.* .text.*)
  162. *libbearssl.a:(.literal .text .literal.* .text.*)
  163. *libat.a:(.literal.* .text.*)
  164. *libcrypto.a:(.literal.* .text.*)
  165. *libespnow.a:(.literal.* .text.*)
  166. *libjson.a:(.literal.* .text.*)
  167. *liblwip.a:(.literal.* .text.*)
  168. *libmesh.a:(.literal.* .text.*)
  169. *libnet80211.a:(.literal.* .text.*)
  170. *libsmartconfig.a:(.literal.* .text.*)
  171. *libssl.a:(.literal.* .text.*)
  172. *libupgrade.a:(.literal.* .text.*)
  173. *libwpa.a:(.literal.* .text.*)
  174. *libwpa2.a:(.literal.* .text.*)
  175. *libwps.a:(.literal.* .text.*)
  176. *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom0.text.* .irom.text .irom.text.*)
  177. /* Constant strings in flash (PSTRs) */
  178. *(.irom0.pstr.*)
  179. /* Inline flash strings PSTR() within templated code */
  180. *(.rodata._ZZ*__pstr__*)
  181. /* __FUNCTION__ locals */
  182. *(.rodata._ZZ*__FUNCTION__)
  183. *(.rodata._ZZ*__PRETTY_FUNCTION__)
  184. *(.rodata._ZZ*__func__)
  185. /* std::* exception strings, in their own section to allow string coalescing */
  186. *(.irom.exceptiontext, .rodata.exceptiontext)
  187. *(.rodata.*__exception_what__*) /* G++ seems to throw out templatized section attributes */
  188. /* c++ typeof IDs, etc. */
  189. *(.rodata._ZTIN* .rodata._ZTSN10* .rodata._ZTISt* .rodata._ZTSSt*)
  190. /* Fundamental type info */
  191. *(.rodata._ZTIPKc .rodata._ZTIc .rodata._ZTIv .rodata._ZTSv .rodata._ZTSc .rodata._ZTSPKc .rodata._ZTSi .rodata._ZTIi)
  192. . = ALIGN(4);
  193. *(.gcc_except_table .gcc_except_table.*)
  194. . = ALIGN(4);
  195. __eh_frame = ABSOLUTE(.);
  196. KEEP(*(.eh_frame))
  197. . = (. + 7) & ~ 3; /* Add a 0 entry to terminate the list */
  198. _irom0_text_end = ABSOLUTE(.);
  199. _flash_code_end = ABSOLUTE(.);
  200. } >irom0_0_seg :irom0_0_phdr
  201. .text1 : ALIGN(4)
  202. {
  203. *(.literal .text .iram.literal .iram.text .iram.text.* .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
  204. *(.fini.literal)
  205. *(.fini)
  206. *(.gnu.version)
  207. _text_end = ABSOLUTE(.);
  208. _etext = .;
  209. } >iram1_0_seg :iram1_0_phdr
  210. .rodata : ALIGN(4)
  211. {
  212. _rodata_start = ABSOLUTE(.);
  213. *(.sdk.version)
  214. *(.rodata)
  215. *(.rodata.*)
  216. *(.gnu.linkonce.r.*)
  217. *(.rodata1)
  218. __XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
  219. *(.xt_except_table)
  220. *(.gcc_except_table)
  221. *(.gnu.linkonce.e.*)
  222. *(.gnu.version_r)
  223. *(.eh_frame)
  224. . = (. + 3) & ~ 3;
  225. /* C++ constructor and destructor tables, properly ordered: */
  226. __init_array_start = ABSOLUTE(.);
  227. KEEP (*crtbegin.o(.ctors))
  228. KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
  229. KEEP (*(SORT(.ctors.*)))
  230. KEEP (*(.ctors))
  231. __init_array_end = ABSOLUTE(.);
  232. KEEP (*crtbegin.o(.dtors))
  233. KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
  234. KEEP (*(SORT(.dtors.*)))
  235. KEEP (*(.dtors))
  236. /* C++ exception handlers table: */
  237. __XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
  238. *(.xt_except_desc)
  239. *(.gnu.linkonce.h.*)
  240. __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
  241. *(.xt_except_desc_end)
  242. *(.dynamic)
  243. *(.gnu.version_d)
  244. . = ALIGN(4); /* this table MUST be 4-byte aligned */
  245. _bss_table_start = ABSOLUTE(.);
  246. LONG(_bss_start)
  247. LONG(_bss_end)
  248. _bss_table_end = ABSOLUTE(.);
  249. _rodata_end = ABSOLUTE(.);
  250. } >dram0_0_seg :dram0_0_phdr
  251. .bss ALIGN(8) (NOLOAD) : ALIGN(4)
  252. {
  253. . = ALIGN (8);
  254. _bss_start = ABSOLUTE(.);
  255. *(.dynsbss)
  256. *(.sbss)
  257. *(.sbss.*)
  258. *(.gnu.linkonce.sb.*)
  259. *(.scommon)
  260. *(.sbss2)
  261. *(.sbss2.*)
  262. *(.gnu.linkonce.sb2.*)
  263. *(.dynbss)
  264. *(.bss)
  265. *(.bss.*)
  266. *(.gnu.linkonce.b.*)
  267. *(COMMON)
  268. . = ALIGN (8);
  269. _bss_end = ABSOLUTE(.);
  270. _heap_start = ABSOLUTE(.);
  271. /* _stack_sentry = ALIGN(0x8); */
  272. } >dram0_0_seg :dram0_0_bss_phdr
  273. /* __stack = 0x3ffc8000; */
  274. .lit4 : ALIGN(4)
  275. {
  276. _lit4_start = ABSOLUTE(.);
  277. *(*.lit4)
  278. *(.lit4.*)
  279. *(.gnu.linkonce.lit4.*)
  280. _lit4_end = ABSOLUTE(.);
  281. } >iram1_0_seg :iram1_0_phdr
  282. }
  283. /* get ROM code address */
  284. INCLUDE "../ld/eagle.rom.addr.v6.ld"