esp32.custom_common.ld 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. /* Default entry point: */
  2. ENTRY(call_start_cpu0);
  3. SECTIONS
  4. {
  5. /* RTC fast memory holds RTC wake stub code,
  6. including from any source file named rtc_wake_stub*.c
  7. */
  8. .rtc.text :
  9. {
  10. . = ALIGN(4);
  11. *(.rtc.literal .rtc.text)
  12. *rtc_wake_stub*.o(.literal .text .literal.* .text.*)
  13. } > rtc_iram_seg
  14. /* RTC slow memory holds RTC wake stub
  15. data/rodata, including from any source file
  16. named rtc_wake_stub*.c
  17. */
  18. .rtc.data :
  19. {
  20. _rtc_data_start = ABSOLUTE(.);
  21. *(.rtc.data)
  22. *(.rtc.rodata)
  23. *rtc_wake_stub*.o(.data .rodata .data.* .rodata.* .bss .bss.*)
  24. _rtc_data_end = ABSOLUTE(.);
  25. } > rtc_slow_seg
  26. /* RTC bss, from any source file named rtc_wake_stub*.c */
  27. .rtc.bss (NOLOAD) :
  28. {
  29. _rtc_bss_start = ABSOLUTE(.);
  30. *rtc_wake_stub*.o(.bss .bss.*)
  31. *rtc_wake_stub*.o(COMMON)
  32. _rtc_bss_end = ABSOLUTE(.);
  33. } > rtc_slow_seg
  34. /* This section holds data that should not be initialized at power up
  35. and will be retained during deep sleep. The section located in
  36. RTC SLOW Memory area. User data marked with RTC_NOINIT_ATTR will be placed
  37. into this section. See the file "esp_attr.h" for more information.
  38. */
  39. .rtc_noinit (NOLOAD):
  40. {
  41. . = ALIGN(4);
  42. _rtc_noinit_start = ABSOLUTE(.);
  43. *(.rtc_noinit .rtc_noinit.*)
  44. . = ALIGN(4) ;
  45. _rtc_noinit_end = ABSOLUTE(.);
  46. } > rtc_slow_seg
  47. /* Send .iram0 code to iram */
  48. .iram0.vectors :
  49. {
  50. /* Vectors go to IRAM */
  51. _init_start = ABSOLUTE(.);
  52. /* Vectors according to builds/RF-2015.2-win32/esp108_v1_2_s5_512int_2/config.html */
  53. . = 0x0;
  54. KEEP(*(.WindowVectors.text));
  55. . = 0x180;
  56. KEEP(*(.Level2InterruptVector.text));
  57. . = 0x1c0;
  58. KEEP(*(.Level3InterruptVector.text));
  59. . = 0x200;
  60. KEEP(*(.Level4InterruptVector.text));
  61. . = 0x240;
  62. KEEP(*(.Level5InterruptVector.text));
  63. . = 0x280;
  64. KEEP(*(.DebugExceptionVector.text));
  65. . = 0x2c0;
  66. KEEP(*(.NMIExceptionVector.text));
  67. . = 0x300;
  68. KEEP(*(.KernelExceptionVector.text));
  69. . = 0x340;
  70. KEEP(*(.UserExceptionVector.text));
  71. . = 0x3C0;
  72. KEEP(*(.DoubleExceptionVector.text));
  73. . = 0x400;
  74. *(.*Vector.literal)
  75. *(.UserEnter.literal);
  76. *(.UserEnter.text);
  77. . = ALIGN (16);
  78. *(.entry.text)
  79. *(.init.literal)
  80. *(.init)
  81. _init_end = ABSOLUTE(.);
  82. /* This goes here, not at top of linker script, so addr2line finds it last,
  83. and uses it in preference to the first symbol in IRAM */
  84. _iram_start = ABSOLUTE(0);
  85. } > iram0_0_seg
  86. .iram0.text :
  87. {
  88. /* Code marked as runnning out of IRAM */
  89. _iram_text_start = ABSOLUTE(.);
  90. *(.iram1 .iram1.*)
  91. *freertos/*(.literal .text .literal.* .text.*)
  92. *heap/multi_heap.o(.literal .text .literal.* .text.*)
  93. *heap/multi_heap_poisoning.o(.literal .text .literal.* .text.*)
  94. *esp32/panic.o(.literal .text .literal.* .text.*)
  95. *esp32/core_dump.o(.literal .text .literal.* .text.*)
  96. *app_trace/*(.literal .text .literal.* .text.*)
  97. *xtensa-debug-module/eri.o(.literal .text .literal.* .text.*)
  98. *librtc.a:(.literal .text .literal.* .text.*)
  99. *soc/esp32/*(.literal .text .literal.* .text.*)
  100. *libhal.a:(.literal .text .literal.* .text.*)
  101. *libgcc.a:lib2funcs.o(.literal .text .literal.* .text.*)
  102. *spi_flash/spi_flash_rom_patch.o(.literal .text .literal.* .text.*)
  103. *libgcov.a:(.literal .text .literal.* .text.*)
  104. INCLUDE esp32.spiram.rom-functions-iram.ld
  105. *py/scheduler.o*(.literal .text .literal.* .text.*)
  106. _iram_text_end = ABSOLUTE(.);
  107. } > iram0_0_seg
  108. .dram0.data :
  109. {
  110. _data_start = ABSOLUTE(.);
  111. *(.data)
  112. *(.data.*)
  113. *(.gnu.linkonce.d.*)
  114. *(.data1)
  115. *(.sdata)
  116. *(.sdata.*)
  117. *(.gnu.linkonce.s.*)
  118. *(.sdata2)
  119. *(.sdata2.*)
  120. *(.gnu.linkonce.s2.*)
  121. *(.jcr)
  122. *(.dram1 .dram1.*)
  123. *esp32/panic.o(.rodata .rodata.*)
  124. *libphy.a:(.rodata .rodata.*)
  125. *soc/esp32/rtc_clk.o(.rodata .rodata.*)
  126. *app_trace/app_trace.o(.rodata .rodata.*)
  127. *libgcov.a:(.rodata .rodata.*)
  128. *heap/multi_heap.o(.rodata .rodata.*)
  129. *heap/multi_heap_poisoning.o(.rodata .rodata.*)
  130. INCLUDE esp32.spiram.rom-functions-dram.ld
  131. _data_end = ABSOLUTE(.);
  132. . = ALIGN(4);
  133. } > dram0_0_seg
  134. /*This section holds data that should not be initialized at power up.
  135. The section located in Internal SRAM memory region. The macro _NOINIT
  136. can be used as attribute to place data into this section.
  137. See the esp_attr.h file for more information.
  138. */
  139. .noinit (NOLOAD):
  140. {
  141. . = ALIGN(4);
  142. _noinit_start = ABSOLUTE(.);
  143. *(.noinit .noinit.*)
  144. . = ALIGN(4) ;
  145. _noinit_end = ABSOLUTE(.);
  146. } > dram0_0_seg
  147. /* Shared RAM */
  148. .dram0.bss (NOLOAD) :
  149. {
  150. . = ALIGN (8);
  151. _bss_start = ABSOLUTE(.);
  152. *(.dynsbss)
  153. *(.sbss)
  154. *(.sbss.*)
  155. *(.gnu.linkonce.sb.*)
  156. *(.scommon)
  157. *(.sbss2)
  158. *(.sbss2.*)
  159. *(.gnu.linkonce.sb2.*)
  160. *(.dynbss)
  161. *(.bss)
  162. *(.bss.*)
  163. *(.share.mem)
  164. *(.gnu.linkonce.b.*)
  165. *(COMMON)
  166. . = ALIGN (8);
  167. _bss_end = ABSOLUTE(.);
  168. /* The heap starts right after end of this section */
  169. _heap_start = ABSOLUTE(.);
  170. } > dram0_0_seg
  171. .flash.rodata :
  172. {
  173. _rodata_start = ABSOLUTE(.);
  174. *(.rodata)
  175. *(.rodata.*)
  176. *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */
  177. *(.gnu.linkonce.r.*)
  178. *(.rodata1)
  179. __XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
  180. *(.xt_except_table)
  181. *(.gcc_except_table .gcc_except_table.*)
  182. *(.gnu.linkonce.e.*)
  183. *(.gnu.version_r)
  184. . = (. + 3) & ~ 3;
  185. __eh_frame = ABSOLUTE(.);
  186. KEEP(*(.eh_frame))
  187. . = (. + 7) & ~ 3;
  188. /* C++ constructor and destructor tables, properly ordered: */
  189. __init_array_start = ABSOLUTE(.);
  190. KEEP (*crtbegin.o(.ctors))
  191. KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
  192. KEEP (*(SORT(.ctors.*)))
  193. KEEP (*(.ctors))
  194. __init_array_end = ABSOLUTE(.);
  195. KEEP (*crtbegin.o(.dtors))
  196. KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
  197. KEEP (*(SORT(.dtors.*)))
  198. KEEP (*(.dtors))
  199. /* C++ exception handlers table: */
  200. __XT_EXCEPTION_DESCS_ = ABSOLUTE(.);
  201. *(.xt_except_desc)
  202. *(.gnu.linkonce.h.*)
  203. __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
  204. *(.xt_except_desc_end)
  205. *(.dynamic)
  206. *(.gnu.version_d)
  207. _rodata_end = ABSOLUTE(.);
  208. /* Literals are also RO data. */
  209. _lit4_start = ABSOLUTE(.);
  210. *(*.lit4)
  211. *(.lit4.*)
  212. *(.gnu.linkonce.lit4.*)
  213. _lit4_end = ABSOLUTE(.);
  214. . = ALIGN(4);
  215. _thread_local_start = ABSOLUTE(.);
  216. *(.tdata)
  217. *(.tdata.*)
  218. *(.tbss)
  219. *(.tbss.*)
  220. _thread_local_end = ABSOLUTE(.);
  221. . = ALIGN(4);
  222. } >drom0_0_seg
  223. .flash.text :
  224. {
  225. _stext = .;
  226. _text_start = ABSOLUTE(.);
  227. *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
  228. *(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */
  229. *(.fini.literal)
  230. *(.fini)
  231. *(.gnu.version)
  232. _text_end = ABSOLUTE(.);
  233. _etext = .;
  234. /* Similar to _iram_start, this symbol goes here so it is
  235. resolved by addr2line in preference to the first symbol in
  236. the flash.text segment.
  237. */
  238. _flash_cache_start = ABSOLUTE(0);
  239. } >iram0_2_seg
  240. }