ESP32 ESP-IDFリンクスクリプトメカニズム

ESP-IDFリンクスクリプトメカニズム

リンクプロセスの制御レベルv3.3をサポートするため最初からのESP-IDF は、ファイルの追加、およびMakefileでの参照において、リンカースクリプト生成メカニズムと文法規則componentを使用するだけで済みます。componentxx.lf

COMPONENT_ADD_LDFRAGMENTS += "xx.lf"

合意された文法に従って内容を記入してください:

\\示例:
[sections:text]
    .text+
    .literal+

[sections:iram]
    .iram1+

[scheme:default]
entries:
    text -> flash_text
    iram -> iram0_text

[scheme:noflash]
entries:
    text -> iram0_text

[mapping:freertos]
archive: libfreertos.a
entries:
    * (noflash)

スクリプトジェネレーターはxx.lfgccリンクフラグメントに変換され、最終的にスクリプトへのプロジェクトのリンクに追加されます。

\\示例:
.iram0.text :
{
    /* Code marked as runnning out of IRAM */
    _iram_text_start = ABSOLUTE(.);

    /* Placement rules generated from the processed fragments, placed where the marker was in the template */
    *(.iram1 .iram1.*)
    *libfreertos.a:(.literal .text .literal.* .text.*)

    _iram_text_end = ABSOLUTE(.);
} > iram0_0_seg

おすすめ

転載: blog.csdn.net/qq_20515461/article/details/108148724