Creating section via Linker-Fragment does not work for me
Posted: Fri Dec 06, 2024 9:08 am
Hi, I wanted to create a section in flash.rodata called y_table and place a symbol of the same name (y_table) into it.
So I created a .lf file with the following contents and added it to the LDFRAGMENTS-part of idf_component_register:
And my variable declaration in "table.cpp" is:
However, this does not work, the result in the *.map file is:
and the assert triggers.
I have tried changing the "archive: archive" part of the .lf File to "archive: libVOS.a" (VOS is the component which includes the fragment and table.cpp), but this results in a parsing error (which I don't understand, as I thought the two statements should have the same effect).
I also tried changing the entries in the sections fragment from ".y_table+" to ".flash.rodata.y_table+", but that did not change anything either.
Can somebody help me find out what I am doing wrong?
So I created a .lf file with the following contents and added it to the LDFRAGMENTS-part of idf_component_register:
Code: Select all
[sections:y_table]
entries:
.y_table+
[scheme:rodata_table]
entries:
y_table -> flash_rodata
[mapping:table]
archive: archive
entries:
table:y_table (rodata_table)
Code: Select all
table_t __attribute__(( section( ".flash.rodata.y_table" ) )) const y_table = {...};
Code: Select all
0x3c0e0120 . = ALIGN (ALIGNOF (.flash.rodata))
0x00000000 ASSERT ((ADDR (.flash.rodata) == (ADDR (.flash.appdesc) + SIZEOF (.flash.appdesc))), The gap between .flash.appdesc and .flash.rodata must not exist to produce the final bin image.)
.flash.rodata.y_table
0x3c0e0120 0x50
.flash.rodata.y_table
0x3c0e0120 0x50 esp-idf/VOS/libVOS.a(table.cpp.obj)
0x3c0e0120 y_table
.flash.rodata 0x3c0e0170 0x44a28
I have tried changing the "archive: archive" part of the .lf File to "archive: libVOS.a" (VOS is the component which includes the fragment and table.cpp), but this results in a parsing error (which I don't understand, as I thought the two statements should have the same effect).
I also tried changing the entries in the sections fragment from ".y_table+" to ".flash.rodata.y_table+", but that did not change anything either.
Can somebody help me find out what I am doing wrong?