-
Notifications
You must be signed in to change notification settings - Fork 64
esp: add linker fragment file #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@georgik fyi |
9d9e567
to
7357b9c
Compare
7357b9c
to
856171d
Compare
Should not |
Do you mind adding some comments and additional context so we can better understand why this file is helpful? I'm not too familiar with the idf so background really helps. |
@rauhul , in IDF 5.3 and later branches, we have added assertions in the linker files to avoid gaps between memory regions. When building Swift examples, additional sections such as
For example, we have ASSERT_SECTIONS_GAP(.flash.appdesc, .flash.rodata), meaning there must not be any other section between .flash.appdesc and .flash.rodata. But as you can see:
Similarly, the Solutions
This way, we can manage the sections effectively and avoid assertion errors without making changes to the ESP-IDF itself. I hope it is clear now. And one question from our side:
|
@erhankur I think it makes sense, but I'm a little concerned how we will handle the Swift compiler adding or removing sections in the future. Maintaining and understanding this sort of file is a big ask for even experienced users and I'm wondering if we can somehow do better. Maybe @kubamracek has thoughts. |
@rauhul We, Espressif, are completely fine with making the necessary modifications to the IDF. However, it is better to see the big picture first to avoid back-and-forth changes. |
I suspect we will need to tweak this file in the future as the swift compiler behavior changes but that's ok. Let's merge it :) |
@rauhul thanks for merging.
I believe it is easier to change this file rather than the IDF :) |
@rauhul @kubamracek This question remained unanswered.
If they could be dropped, we wouldn’t need a linker fragment file. |
With the help of linker fragment files, it is possible to specify custom placements at the component level within ESP-IDF.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/linker-script-generation.html