eagle.app.v6.common.ld.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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 = MMU_IRAM_SIZE
  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. #ifdef VTABLES_IN_DRAM
  91. #include "eagle.app.v6.common.ld.vtables.h"
  92. #endif
  93. /* IRAM is split into .text and .text1 to allow for moving specific */
  94. /* functions into IRAM that would be matched by the irom0.text matcher */
  95. .text : ALIGN(4)
  96. {
  97. _stext = .;
  98. _text_start = ABSOLUTE(.);
  99. *(.UserEnter.text)
  100. . = ALIGN(16);
  101. *(.DebugExceptionVector.text)
  102. . = ALIGN(16);
  103. *(.NMIExceptionVector.text)
  104. . = ALIGN(16);
  105. *(.KernelExceptionVector.text)
  106. LONG(0)
  107. LONG(0)
  108. LONG(0)
  109. LONG(0)
  110. . = ALIGN(16);
  111. *(.UserExceptionVector.text)
  112. LONG(0)
  113. LONG(0)
  114. LONG(0)
  115. LONG(0)
  116. . = ALIGN(16);
  117. *(.DoubleExceptionVector.text)
  118. LONG(0)
  119. LONG(0)
  120. LONG(0)
  121. LONG(0)
  122. . = ALIGN (16);
  123. *(.entry.text)
  124. *(.init.literal)
  125. *(.init)
  126. *(.text.app_entry*) /* The main startup code */
  127. *(.text.gdbstub*, .text.gdb_init) /* Any GDB hooks */
  128. /* all functional callers are placed in IRAM (including SPI/IRQ callbacks/etc) here */
  129. *(.text._ZNKSt8functionIF*EE*) /* std::function<any(...)>::operator()() const */
  130. } >iram1_0_seg :iram1_0_phdr
  131. .irom0.text : ALIGN(4)
  132. {
  133. _irom0_text_start = ABSOLUTE(.);
  134. /* Stuff the CRC in well known symbols at a well known location */
  135. __crc_len = ABSOLUTE(.);
  136. LONG(0x00000000);
  137. __crc_val = ABSOLUTE(.);
  138. LONG(0x00000000);
  139. *(.ver_number)
  140. *.c.o(.literal*, .text*)
  141. *.cpp.o(EXCLUDE_FILE (umm_malloc.cpp.o) .literal*, EXCLUDE_FILE (umm_malloc.cpp.o) .text*)
  142. *.cc.o(.literal*, .text*)
  143. #ifdef VTABLES_IN_FLASH
  144. *(.rodata._ZTV*) /* C++ vtables */
  145. #endif
  146. *libgcc.a:unwind-dw2.o(.literal .text .rodata .literal.* .text.* .rodata.*)
  147. *libgcc.a:unwind-dw2-fde.o(.literal .text .rodata .literal.* .text.* .rodata.*)
  148. *libc.a:(.literal .text .literal.* .text.*)
  149. *libm.a:(.literal .text .literal.* .text.*)
  150. #ifdef FP_IN_IROM
  151. *libgcc.a:*f2.o(.literal .text)
  152. *libgcc.a:*f3.o(.literal .text)
  153. *libgcc.a:*fsi.o(.literal .text)
  154. *libgcc.a:*fdi.o(.literal .text)
  155. *libgcc.a:*ifs.o(.literal .text)
  156. *libgcc.a:*idf.o(.literal .text)
  157. #endif
  158. *libgcc.a:_umoddi3.o(.literal .text)
  159. *libgcc.a:_udivdi3.o(.literal .text)
  160. *libgcc.a:_divsf3.o(.literal .text)
  161. *libgcc.a:_fixsfsi.o(.literal .text)
  162. *libgcc.a:_cmpdf2.o(.literal .text)
  163. *libgcc.a:_cmpsf2.o(.literal .text)
  164. *libstdc++.a:( .literal .text .literal.* .text.*)
  165. *libstdc++-exc.a:( .literal .text .literal.* .text.*)
  166. *libsmartconfig.a:(.literal .text .literal.* .text.*)
  167. *liblwip_gcc.a:(.literal .text .literal.* .text.*)
  168. *liblwip_src.a:(.literal .text .literal.* .text.*)
  169. *liblwip2-536.a:(.literal .text .literal.* .text.*)
  170. *liblwip2-1460.a:(.literal .text .literal.* .text.*)
  171. *liblwip2-536-feat.a:(.literal .text .literal.* .text.*)
  172. *liblwip2-1460-feat.a:(.literal .text .literal.* .text.*)
  173. *liblwip6-536-feat.a:(.literal .text .literal.* .text.*)
  174. *liblwip6-1460-feat.a:(.literal .text .literal.* .text.*)
  175. *libbearssl.a:(.literal .text .literal.* .text.*)
  176. *libat.a:(.literal.* .text.*)
  177. *libcrypto.a:(.literal.* .text.*)
  178. *libespnow.a:(.literal.* .text.*)
  179. *libjson.a:(.literal.* .text.*)
  180. *liblwip.a:(.literal.* .text.*)
  181. *libmesh.a:(.literal.* .text.*)
  182. *libnet80211.a:(.literal.* .text.*)
  183. *libsmartconfig.a:(.literal.* .text.*)
  184. *libssl.a:(.literal.* .text.*)
  185. *libupgrade.a:(.literal.* .text.*)
  186. *libwpa.a:(.literal.* .text.*)
  187. *libwpa2.a:(.literal.* .text.*)
  188. *libwps.a:(.literal.* .text.*)
  189. *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom0.text.* .irom.text .irom.text.*)
  190. /* Constant strings in flash (PSTRs) */
  191. *(.irom0.pstr.*)
  192. /* Inline flash strings PSTR() within templated code */
  193. *(.rodata._ZZ*__pstr__*)
  194. /* __FUNCTION__ locals */
  195. *(.rodata._ZZ*__FUNCTION__)
  196. *(.rodata._ZZ*__PRETTY_FUNCTION__)
  197. *(.rodata._ZZ*__func__)
  198. /* std::* exception strings, in their own section to allow string coalescing */
  199. *(.irom.exceptiontext, .rodata.exceptiontext)
  200. *(.rodata.*__exception_what__*) /* G++ seems to throw out templatized section attributes */
  201. /* c++ typeof IDs, etc. */
  202. *(.rodata._ZTIN* .rodata._ZTSN10* .rodata._ZTISt* .rodata._ZTSSt*)
  203. /* Fundamental type info */
  204. *(.rodata._ZTIPKc .rodata._ZTIc .rodata._ZTIv .rodata._ZTSv .rodata._ZTSc .rodata._ZTSPKc .rodata._ZTSi .rodata._ZTIi)
  205. . = ALIGN(4);
  206. *(.gcc_except_table .gcc_except_table.*)
  207. . = ALIGN(4);
  208. __eh_frame = ABSOLUTE(.);
  209. KEEP(*(.eh_frame))
  210. . = (. + 7) & ~ 3; /* Add a 0 entry to terminate the list */
  211. _irom0_text_end = ABSOLUTE(.);
  212. _flash_code_end = ABSOLUTE(.);
  213. } >irom0_0_seg :irom0_0_phdr
  214. .text1 : ALIGN(4)
  215. {
  216. *(.literal .text .iram.literal .iram.text .iram.text.* .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
  217. #ifdef VTABLES_IN_IRAM
  218. *(.rodata._ZTV*) /* C++ vtables */
  219. #endif
  220. *(.fini.literal)
  221. *(.fini)
  222. *(.gnu.version)
  223. _text_end = ABSOLUTE(.);
  224. _etext = .;
  225. } >iram1_0_seg :iram1_0_phdr
  226. #if defined(VTABLES_IN_IRAM) || defined(VTABLES_IN_FLASH)
  227. #include "eagle.app.v6.common.ld.vtables.h"
  228. #endif
  229. .lit4 : ALIGN(4)
  230. {
  231. _lit4_start = ABSOLUTE(.);
  232. *(*.lit4)
  233. *(.lit4.*)
  234. *(.gnu.linkonce.lit4.*)
  235. _lit4_end = ABSOLUTE(.);
  236. } >iram1_0_seg :iram1_0_phdr
  237. }
  238. /* get ROM code address */
  239. INCLUDE "../ld/eagle.rom.addr.v6.ld"