Commit a146d71
committed
misc: Implement two-pass linking to separate rodata sections.
This patch changes the build to perform two-pass linking to separate rodata
with relocations (copied to RAM) from rodata with no relocations (pure data)
that can be kept in flash by llext.
For dynamic linking mode:
- First pass: Link with build-dynamic.ld to create temp ELF (unchanged).
- Analyze the elf and extract, sort and write out the sections:
- .rodata: sections WITH relocations → copied to RAM (LLEXT_MEM_RODATA)
- .rodata_noreloc: sections WITHOUT relocations → kept in flash (LLEXT_MEM_RODATA_NO_RELOC)
- Second pass: Link with generated rodata_split.ld + build-dynamic.ld.
For static linking mode:
- Generates empty rodata_split.ld (no section separation needed)
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>1 parent 5f0e907 commit a146d71
2 files changed
+5
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
119 | | - | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
| 123 | + | |
| 124 | + | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | 45 | | |
52 | 46 | | |
53 | 47 | | |
| |||
82 | 76 | | |
83 | 77 | | |
84 | 78 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 79 | | |
90 | 80 | | |
91 | 81 | | |
| |||
0 commit comments