Skip to content

Commit 2eb2975

Browse files
authored
esp: add a linker fragment file to map swift sections to the correct memory regions (#26)
1 parent ab9a24c commit 2eb2975

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

esp32-led-blink-sdk/main/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
idf_component_register(
22
SRCS "Dummy.c"
33
INCLUDE_DIRS "."
4+
LDFRAGMENTS "linker.lf"
45
)
56

67
idf_build_get_property(target IDF_TARGET)

esp32-led-blink-sdk/main/linker.lf

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[sections:flash_text_swift]
2+
entries:
3+
.swift_modhash+
4+
5+
[sections:dram0_swift]
6+
entries:
7+
.got+
8+
.got.plt+
9+
10+
[scheme:swift_default]
11+
entries:
12+
flash_text_swift -> flash_text
13+
dram0_swift -> dram0_data
14+
15+
[mapping:swift_default]
16+
archive: *
17+
entries:
18+
* (swift_default);
19+
flash_text_swift -> flash_text SURROUND (swift_text),
20+
dram0_swift -> dram0_data SURROUND (swift_dram0)

esp32-led-strip-sdk/main/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
idf_component_register(
22
SRCS "Dummy.c"
33
INCLUDE_DIRS "."
4+
LDFRAGMENTS "linker.lf"
45
)
56

67
idf_build_get_property(target IDF_TARGET)

esp32-led-strip-sdk/main/linker.lf

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[sections:flash_text_swift]
2+
entries:
3+
.swift_modhash+
4+
5+
[sections:dram0_swift]
6+
entries:
7+
.got+
8+
.got.plt+
9+
10+
[scheme:swift_default]
11+
entries:
12+
flash_text_swift -> flash_text
13+
dram0_swift -> dram0_data
14+
15+
[mapping:swift_default]
16+
archive: *
17+
entries:
18+
* (swift_default);
19+
flash_text_swift -> flash_text SURROUND (swift_text),
20+
dram0_swift -> dram0_data SURROUND (swift_dram0)

0 commit comments

Comments
 (0)