linker-script-generation.rst 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. Linker Script Generation
  2. ========================
  3. :link_to_translation:`zh_CN:[中文]`
  4. Overview
  5. --------
  6. There are several :ref:`memory regions<memory-layout>` where code and data can be placed. Code and read-only data are placed by default in flash, writable data in RAM, etc. However, it is sometimes necessary to change these default placements.
  7. .. only:: SOC_ULP_SUPPORTED
  8. For example, it may be necessary to place critical code in RAM for performance reasons or to place code in RTC memory for use in a wake stub or the ULP coprocessor.
  9. .. only:: not SOC_ULP_SUPPORTED
  10. For example, it may be necessary to place critical code in RAM for performance reasons or to place code in RTC memory for use in a wake stub.
  11. With the linker script generation mechanism, it is possible to specify these placements at the component level within ESP-IDF. The component presents information on how it would like to place its symbols, objects or the entire archive. During build, the information presented by the components are collected, parsed and processed; and the placement rules generated is used to link the app.
  12. Quick Start
  13. ------------
  14. This section presents a guide for quickly placing code/data to RAM and RTC memory - placements ESP-IDF provides out-of-the-box.
  15. For this guide, suppose we have the following::
  16. - components/
  17. - my_component/
  18. - CMakeLists.txt
  19. - component.mk
  20. - Kconfig
  21. - src/
  22. - my_src1.c
  23. - my_src2.c
  24. - my_src3.c
  25. - my_linker_fragment_file.lf
  26. - a component named ``my_component`` that is archived as library ``libmy_component.a`` during build
  27. - three source files archived under the library, ``my_src1.c``, ``my_src2.c`` and ``my_src3.c`` which are compiled as ``my_src1.o``, ``my_src2.o`` and ``my_src3.o``, respectively
  28. - under ``my_src1.o``, the function ``my_function1`` is defined; under ``my_src2.o``, the function ``my_function2`` is defined
  29. - there is bool-type config ``PERFORMANCE_MODE`` (y/n) and int type config ``PERFORMANCE_LEVEL`` (with range 0-3) in ``my_component``'s Kconfig
  30. Creating and Specifying a Linker Fragment File
  31. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  32. Before anything else, a linker fragment file needs to be created. A linker fragment file is simply a text file with a ``.lf`` extension upon which the desired placements will be written. After creating the file, it is then necessary to present it to the build system. The instructions for the build systems supported by ESP-IDF are as follows:
  33. In the component's ``CMakeLists.txt`` file, specify argument ``LDFRAGMENTS`` in the ``idf_component_register`` call. The value of ``LDFRAGMENTS`` can either be an absolute path or a relative path from the component directory to the created linker fragment file.
  34. .. code-block:: cmake
  35. # file paths relative to CMakeLists.txt
  36. idf_component_register(...
  37. LDFRAGMENTS "path/to/linker_fragment_file.lf" "path/to/another_linker_fragment_file.lf"
  38. ...
  39. )
  40. Specifying placements
  41. ^^^^^^^^^^^^^^^^^^^^^
  42. It is possible to specify placements at the following levels of granularity:
  43. - object file (``.obj`` or ``.o`` files)
  44. - symbol (function/variable)
  45. - archive (``.a`` files)
  46. .. _ldgen-placing-object-files :
  47. Placing object files
  48. """"""""""""""""""""
  49. Suppose the entirety of ``my_src1.o`` is performance-critical, so it is desirable to place it in RAM. On the other hand, the entirety of ``my_src2.o`` contains symbols needed coming out of deep sleep, so it needs to be put under RTC memory.
  50. In the the linker fragment file, we can write:
  51. .. code-block:: none
  52. [mapping:my_component]
  53. archive: libmy_component.a
  54. entries:
  55. my_src1 (noflash) # places all my_src1 code/read-only data under IRAM/DRAM
  56. my_src2 (rtc) # places all my_src2 code/ data and read-only data under RTC fast memory/RTC slow memory
  57. What happens to ``my_src3.o``? Since it is not specified, default placements are used for ``my_src3.o``. More on default placements :ref:`here<ldgen-default-placements>`.
  58. Placing symbols
  59. """"""""""""""""
  60. Continuing our example, suppose that among functions defined under ``object1.o``, only ``my_function1`` is performance-critical; and under ``object2.o``, only ``my_function2`` needs to execute after the chip comes out of deep sleep. This could be accomplished by writing:
  61. .. code-block:: none
  62. [mapping:my_component]
  63. archive: libmy_component.a
  64. entries:
  65. my_src1:my_function1 (noflash)
  66. my_src2:my_function2 (rtc)
  67. The default placements are used for the rest of the functions in ``my_src1.o`` and ``my_src2.o`` and the entire ``object3.o``. Something similar can be achieved for placing data by writing the variable name instead of the function name, like so::
  68. my_src1:my_variable (noflash)
  69. .. warning::
  70. There are :ref:`limitations<ldgen-symbol-granularity-placements>` in placing code/data at symbol granularity. In order to ensure proper placements, an alternative would be to group relevant code and data into source files, and :ref:`use object-granularity placements<ldgen-placing-object-files>`.
  71. Placing entire archive
  72. """""""""""""""""""""""
  73. In this example, suppose that the entire component archive needs to be placed in RAM. This can be written as:
  74. .. code-block:: none
  75. [mapping:my_component]
  76. archive: libmy_component.a
  77. entries:
  78. * (noflash)
  79. Similarly, this places the entire component in RTC memory:
  80. .. code-block:: none
  81. [mapping:my_component]
  82. archive: libmy_component.a
  83. entries:
  84. * (rtc)
  85. Configuration-dependent placements
  86. """"""""""""""""""""""""""""""""""
  87. Suppose that the entire component library should only have special placement when a certain condition is true; for example, when ``CONFIG_PERFORMANCE_MODE == y``. This could be written as:
  88. .. code-block:: none
  89. [mapping:my_component]
  90. archive: libmy_component.a
  91. entries:
  92. if PERFORMANCE_MODE = y:
  93. * (noflash)
  94. else:
  95. * (default)
  96. For a more complex config-dependent placement, suppose the following requirements: when ``CONFIG_PERFORMANCE_LEVEL == 1``, only ``object1.o`` is put in RAM; when ``CONFIG_PERFORMANCE_LEVEL == 2``, ``object1.o`` and ``object2.o``; and when ``CONFIG_PERFORMANCE_LEVEL == 3`` all object files under the archive are to be put into RAM. When these three are false however, put entire library in RTC memory. This scenario is a bit contrived, but, it can be written as:
  97. .. code-block:: none
  98. [mapping:my_component]
  99. archive: libmy_component.a
  100. entries:
  101. if PERFORMANCE_LEVEL = 1:
  102. my_src1 (noflash)
  103. elif PERFORMANCE_LEVEL = 2:
  104. my_src1 (noflash)
  105. my_src2 (noflash)
  106. elif PERFORMANCE_LEVEL = 3:
  107. my_src1 (noflash)
  108. my_src2 (noflash)
  109. my_src3 (noflash)
  110. else:
  111. * (rtc)
  112. Nesting condition-checking is also possible. The following is equivalent to the snippet above:
  113. .. code-block:: none
  114. [mapping:my_component]
  115. archive: libmy_component.a
  116. entries:
  117. if PERFORMANCE_LEVEL <= 3 && PERFORMANCE_LEVEL > 0:
  118. if PERFORMANCE_LEVEL >= 1:
  119. object1 (noflash)
  120. if PERFORMANCE_LEVEL >= 2:
  121. object2 (noflash)
  122. if PERFORMANCE_LEVEL >= 3:
  123. object2 (noflash)
  124. else:
  125. * (rtc)
  126. .. _ldgen-default-placements:
  127. The 'default' placements
  128. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  129. Up until this point, the term 'default placements' has been mentioned as fallback placements when the placement rules ``rtc`` and ``noflash`` are not specified. It is important to note that the tokens ``noflash`` or ``rtc`` are not merely keywords, but are actually entities called fragments, specifically :ref:`schemes<ldgen-scheme-fragment>`.
  130. In the same manner as ``rtc`` and ``noflash`` are schemes, there exists a ``default`` scheme which defines what the default placement rules should be. As the name suggests, it is where code and data are usually placed, i.e. code/constants is placed in flash, variables placed in RAM, etc. More on the default scheme :ref:`here<ldgen-default-scheme>`.
  131. .. note::
  132. For an example of an ESP-IDF component using the linker script generation mechanism, see :component_file:`freertos/CMakeLists.txt`. ``freertos`` uses this to place its object files to the instruction RAM for performance reasons.
  133. This marks the end of the quick start guide. The following text discusses the internals of the mechanism in a little bit more detail. The following sections should be helpful in creating custom placements or modifying default behavior.
  134. Linker Script Generation Internals
  135. ----------------------------------
  136. Linking is the last step in the process of turning C/C++ source files into an executable. It is performed by the toolchain's linker, and accepts linker scripts which specify code/data placements, among other things. With the linker script generation mechanism, this process is no different, except that the linker script passed to the linker is dynamically generated from: (1) the collected :ref:`linker fragment files<ldgen-linker-fragment-files>` and (2) :ref:`linker script template<ldgen-linker-script-template>`.
  137. .. note::
  138. The tool that implements the linker script generation mechanism lives under :idf:`tools/ldgen`.
  139. .. _ldgen-linker-fragment-files :
  140. Linker Fragment Files
  141. ^^^^^^^^^^^^^^^^^^^^^
  142. As mentioned in the quick start guide, fragment files are simple text files with the ``.lf`` extension containing the desired placements. This is a simplified description of what fragment files contain, however. What fragment files actually contain are 'fragments'. Fragments are entities which contain pieces of information which, when put together, form placement rules that tell where to place sections of object files in the output binary. There are three types of fragments: :ref:`sections<ldgen-sections-fragment>`, :ref:`scheme<ldgen-scheme-fragment>` and :ref:`mapping<ldgen-mapping-fragment>`.
  143. Grammar
  144. """""""
  145. The three fragment types share a common grammar:
  146. .. code-block:: none
  147. [type:name]
  148. key: value
  149. key:
  150. value
  151. value
  152. value
  153. ...
  154. - type: Corresponds to the fragment type, can either be ``sections``, ``scheme`` or ``mapping``.
  155. - name: The name of the fragment, should be unique for the specified fragment type.
  156. - key, value: Contents of the fragment; each fragment type may support different keys and different grammars for the key values.
  157. .. note::
  158. In cases where multiple fragments of the same type and name are encountered, an exception is thrown.
  159. .. note::
  160. The only valid characters for fragment names and keys are alphanumeric characters and underscore.
  161. .. _ldgen-condition-checking :
  162. **Condition Checking**
  163. Condition checking enable the linker script generation to be configuration-aware. Depending on whether expressions involving configuration values are true or not, a particular set of values for a key can be used. The evaluation uses ``eval_string`` from kconfiglib package and adheres to its required syntax and limitations. Supported operators are as follows:
  164. - comparison
  165. - LessThan ``<``
  166. - LessThanOrEqualTo ``<=``
  167. - MoreThan ``>``
  168. - MoreThanOrEqualTo ``>=``
  169. - Equal ``=``
  170. - NotEqual ``!=``
  171. - logical
  172. - Or ``||``
  173. - And ``&&``
  174. - Negation ``!``
  175. - grouping
  176. - Parenthesis ``()``
  177. Condition checking behaves as you would expect an ``if...elseif/elif...else`` block in other languages. Condition-checking is possible for both key values and entire fragments. The two sample fragments below are equivalent:
  178. .. code-block:: none
  179. # Value for keys is dependent on config
  180. [type:name]
  181. key_1:
  182. if CONDITION = y:
  183. value_1
  184. else:
  185. value_2
  186. key_2:
  187. if CONDITION = y:
  188. value_a
  189. else:
  190. value_b
  191. .. code-block:: none
  192. # Entire fragment definition is dependent on config
  193. if CONDITION = y:
  194. [type:name]
  195. key_1:
  196. value_1
  197. key_2:
  198. value_b
  199. else:
  200. [type:name]
  201. key_1:
  202. value_2
  203. key_2:
  204. value_b
  205. **Comments**
  206. Comment in linker fragment files begin with ``#``. Like in other languages, comment are used to provide helpful descriptions and documentation and are ignored during processing.
  207. Compatibility with ESP-IDF v3.x Linker Script Fragment Files
  208. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  209. ESP-IDF v4.0 brings some changes to the linker script fragment file grammar:
  210. - indentation is enforced and improperly indented fragment files generate a parse exception; this was not enforced in the old version but previous documentation and examples demonstrates properly indented grammar
  211. - move to ``if...elif...else`` structure for conditionals, with the ability to nest checks and place entire fragments themselves inside conditionals
  212. - mapping fragments now requires a name like other fragment types
  213. Linker script generator should be able to parse ESP-IDF v3.x linker fragment files that are indented properly (as demonstrated by the ESP-IDF v3.x version of this document). Backward compatibility with the previous mapping fragment grammar (optional name and the old grammar for conditionals) has also been retained but with a deprecation warning. Users should switch to the newer grammar discussed in this document as support for the old grammar is planned to be removed in the future.
  214. Note that linker fragment files using the new ESP-IDF v4.0 grammar is not supported on ESP-IDF v3.x, however.
  215. Types
  216. """""
  217. .. _ldgen-sections-fragment :
  218. **Sections**
  219. Sections fragments defines a list of object file sections that the GCC compiler emits. It may be a default section (e.g. ``.text``, ``.data``) or it may be user defined section through the ``__attribute__`` keyword.
  220. The use of an optional '+' indicates the inclusion of the section in the list, as well as sections that start with it. This is the preferred method over listing both explicitly.
  221. .. code-block:: none
  222. [sections:name]
  223. entries:
  224. .section+
  225. .section
  226. ...
  227. Example:
  228. .. code-block:: none
  229. # Non-preferred
  230. [sections:text]
  231. entries:
  232. .text
  233. .text.*
  234. .literal
  235. .literal.*
  236. # Preferred, equivalent to the one above
  237. [sections:text]
  238. entries:
  239. .text+ # means .text and .text.*
  240. .literal+ # means .literal and .literal.*
  241. .. _ldgen-scheme-fragment :
  242. **Scheme**
  243. Scheme fragments define what ``target`` a sections fragment is assigned to.
  244. .. code-block:: none
  245. [scheme:name]
  246. entries:
  247. sections -> target
  248. sections -> target
  249. ...
  250. Example:
  251. .. code-block:: none
  252. [scheme:noflash]
  253. entries:
  254. text -> iram0_text # the entries under the sections fragment named text will go to iram0_text
  255. rodata -> dram0_data # the entries under the sections fragment named rodata will go to dram0_data
  256. .. _ldgen-default-scheme:
  257. The ``default`` scheme
  258. There exists a special scheme with the name ``default``. This scheme is special because catch-all placement rules are generated from its entries. This means that, if one of its entries is ``text -> flash_text``, the placement rule will be generated for the target ``flash_text``.
  259. .. code-block:: none
  260. *(.literal .literal.* .text .text.*)
  261. These catch-all rules then effectively serve as fallback rules for those whose mappings were not specified.
  262. The ``default scheme`` is defined in :component_file:`esp_system/app.lf`. The ``noflash`` and ``rtc`` scheme fragments which are
  263. built-in schemes referenced in the quick start guide are also defined in this file.
  264. .. _ldgen-mapping-fragment :
  265. **Mapping**
  266. Mapping fragments define what scheme fragment to use for mappable entities, i.e. object files, function names, variable names, archives.
  267. .. code-block:: none
  268. [mapping:name]
  269. archive: archive # output archive file name, as built (i.e. libxxx.a)
  270. entries:
  271. object:symbol (scheme) # symbol granularity
  272. object (scheme) # object granularity
  273. * (scheme) # archive granularity
  274. There are three levels of placement granularity:
  275. - symbol: The object file name and symbol name are specified. The symbol name can be a function name or a variable name.
  276. - object: Only the object file name is specified.
  277. - archive: ``*`` is specified, which is a short-hand for all the object files under the archive.
  278. To know what an entry means, let us expand a sample object-granularity placement:
  279. .. code-block:: none
  280. object (scheme)
  281. Then expanding the scheme fragment from its entries definitions, we have:
  282. .. code-block:: none
  283. object (sections -> target,
  284. sections -> target,
  285. ...)
  286. Expanding the sections fragment with its entries definition:
  287. .. code-block:: none
  288. object (.section, # given this object file
  289. .section, # put its sections listed here at this
  290. ... -> target, # target
  291. .section,
  292. .section, # same should be done for these sections
  293. ... -> target,
  294. ...) # and so on
  295. Example:
  296. .. code-block:: none
  297. [mapping:map]
  298. archive: libfreertos.a
  299. entries:
  300. * (noflash)
  301. Aside from the entity and scheme, flags can also be specified in an entry. The following flags are supported (note: <> = argument name, [] = optional):
  302. 1. ALIGN(<alignment>[, pre, post])
  303. Align the placement by the amount specified in ``alignment``. Generates
  304. .. code-block::none
  305. . = ALIGN(<alignment>)
  306. before and/or after (depending whether ``pre``, ``post`` or both are specified) the input section description generated from the mapping fragment entry. If neither 'pre' or 'post' is specified, the alignment command is generated before the input section description. Order sensitive.
  307. 2. SORT([<sort_by_first>, <sort_by_second>])
  308. Emits ``SORT_BY_NAME``, ``SORT_BY_ALIGNMENT``, ``SORT_BY_INIT_PRIORITY`` or ``SORT`` in the input section description.
  309. Possible values for ``sort_by_first`` and ``sort_by_second`` are: ``name``, ``alignment``, ``init_priority``.
  310. If both ``sort_by_first`` and ``sort_by_second`` are not specified, the input sections are sorted by name. If both are specified, then the nested sorting follows the same rules discussed in https://sourceware.org/binutils/docs/ld/Input-Section-Wildcards.html.
  311. 3. KEEP()
  312. Prevent the linker from discarding the placement by surrounding the input section description with KEEP command. See https://sourceware.org/binutils/docs/ld/Input-Section-Keep.html for more details.
  313. 4.SURROUND(<name>)
  314. Generate symbols before and after the placement. The generated symbols follow the naming ``_<name>_start`` and ``_<name>_end``. For example, if ``name`` == sym1,
  315. .. code-block::none
  316. _sym1_start = ABSOLUTE(.)
  317. ...
  318. _sym2_end = ABSOLUTE(.)
  319. These symbols can then be referenced from C/C++ code. Order sensitive.
  320. When adding flags, the specific ``section -> target`` in the scheme needs to be specified. For multiple ``section -> target``, use a comma as a separator. For example,
  321. .. code-block:: none
  322. # Notes:
  323. # A. semicolon after entity-scheme
  324. # B. comma before section2 -> target2
  325. # C. section1 -> target1 and section2 -> target2 should be defined in entries of scheme1
  326. entity1 (scheme1);
  327. section1 -> target1 KEEP() ALIGN(4, pre, post),
  328. section2 -> target2 SURROUND(sym) ALIGN(4, post) SORT()
  329. Putting it all together, the following mapping fragment, for example,
  330. .. code-block:: none
  331. [mapping:name]
  332. archive: lib1.a
  333. entries:
  334. obj1 (noflash);
  335. rodata -> dram0_data KEEP() SORT() ALIGN(8) SURROUND(my_sym)
  336. generates an output on the linker script:
  337. .. code-block:: none
  338. . = ALIGN(8)
  339. _my_sym_start = ABSOLUTE(.)
  340. KEEP(lib1.a:obj1.*( SORT(.rodata) SORT(.rodata.*) ))
  341. _my_sym_end = ABSOLUTE(.)
  342. Note that ALIGN and SURROUND, as mentioned in the flag descriptions, are order sensitive. Therefore, if for the same mapping fragment these two are switched, the following is generated instead:
  343. .. code-block:: none
  344. _my_sym_start = ABSOLUTE(.)
  345. . = ALIGN(8)
  346. KEEP(lib1.a:obj1.*( SORT(.rodata) SORT(.rodata.*) ))
  347. _my_sym_end = ABSOLUTE(.)
  348. .. _ldgen-symbol-granularity-placements :
  349. On Symbol-Granularity Placements
  350. """"""""""""""""""""""""""""""""
  351. Symbol granularity placements is possible due to compiler flags ``-ffunction-sections`` and ``-ffdata-sections``. ESP-IDF compiles with these flags by default.
  352. If the user opts to remove these flags, then the symbol-granularity placements will not work. Furthermore, even with the presence of these flags, there are still other limitations to keep in mind due to the dependence on the compiler's emitted output sections.
  353. For example, with ``-ffunction-sections``, separate sections are emitted for each function; with section names predictably constructed i.e. ``.text.{func_name}`` and ``.literal.{func_name}``. This is not the case for string literals within the function, as they go to pooled or generated section names.
  354. With ``-fdata-sections``, for global scope data the compiler predictably emits either ``.data.{var_name}``, ``.rodata.{var_name}`` or ``.bss.{var_name}``; and so ``Type I`` mapping entry works for these.
  355. However, this is not the case for static data declared in function scope, as the generated section name is a result of mangling the variable name with some other information.
  356. .. _ldgen-linker-script-template :
  357. Linker Script Template
  358. ^^^^^^^^^^^^^^^^^^^^^^
  359. The linker script template is the skeleton in which the generated placement rules are put into. It is an otherwise ordinary linker script, with a specific marker syntax that indicates where the generated placement rules are placed.
  360. To reference the placement rules collected under a ``target`` token, the following syntax is used:
  361. .. code-block:: none
  362. mapping[target]
  363. Example:
  364. The example below is an excerpt from a possible linker script template. It defines an output section ``.iram0.text``, and inside is a marker referencing the target ``iram0_text``.
  365. .. code-block:: none
  366. .iram0.text :
  367. {
  368. /* Code marked as runnning out of IRAM */
  369. _iram_text_start = ABSOLUTE(.);
  370. /* Marker referencing iram0_text */
  371. mapping[iram0_text]
  372. _iram_text_end = ABSOLUTE(.);
  373. } > iram0_0_seg
  374. Suppose the generator collected the fragment definitions below:
  375. .. code-block:: none
  376. [sections:text]
  377. .text+
  378. .literal+
  379. [sections:iram]
  380. .iram1+
  381. [scheme:default]
  382. entries:
  383. text -> flash_text
  384. iram -> iram0_text
  385. [scheme:noflash]
  386. entries:
  387. text -> iram0_text
  388. [mapping:freertos]
  389. archive: libfreertos.a
  390. entries:
  391. * (noflash)
  392. Then the corresponding excerpt from the generated linker script will be as follows:
  393. .. code-block:: c
  394. .iram0.text :
  395. {
  396. /* Code marked as runnning out of IRAM */
  397. _iram_text_start = ABSOLUTE(.);
  398. /* Placement rules generated from the processed fragments, placed where the marker was in the template */
  399. *(.iram1 .iram1.*)
  400. *libfreertos.a:(.literal .text .literal.* .text.*)
  401. _iram_text_end = ABSOLUTE(.);
  402. } > iram0_0_seg
  403. ``*libfreertos.a:(.literal .text .literal.* .text.*)``
  404. Rule generated from the entry ``* (noflash)`` of the ``freertos`` mapping fragment. All ``text`` sections of all object files under the archive ``libfreertos.a`` will be collected under the target ``iram0_text`` (as per the ``noflash`` scheme) and placed wherever in the template ``iram0_text`` is referenced by a marker.
  405. ``*(.iram1 .iram1.*)``
  406. Rule generated from the default scheme entry ``iram -> iram0_text``. Since the default scheme specifies an ``iram -> iram0_text`` entry, it too is placed wherever ``iram0_text`` is referenced by a marker. Since it is a rule generated from the default scheme, it comes first among all other rules collected under the same target name.
  407. The linker script template currently used is :component_file:`esp_system/ld/{IDF_TARGET_PATH_NAME}/sections.ld.in`; the generated output script ``sections.ld`` is put under its build directory.