Commit 99219ce
toolchain: gcc: iar: add ___in_section_unique()
Macros __in_section_unique() and __in_section_unique_named() use
___in_section with __FILE__ argument to create a unique section name.
Since __FILE__ is a string, calling Z_STRINGIFY(__FILE__) in
___in_section() causes double quotes in __FILE__ value to be masked.
This prevents ld from matching section names output by this script.
For example, when using CONFIG_CODE_DATA_RELOCATION to relocate
a noinit section, __in_section_unique() generates the following
section name:
KEEP(*file.c.obj(.noinit."WEST_TOPDIR/path/file.c".symbol))
Besides, __FILE__ is used to create unique sections in two macros,
so why not unify this approach.
This fix adds ___in_section_unique() macro, which substitutes __FILE__
string into section name without additional stringification. Thus,
resulting section is correctly matched by ld.
Signed-off-by: Nikita Divakov <grommerin@gmail.com>1 parent e163da3 commit 99219ce
2 files changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
203 | 208 | | |
204 | | - | |
| 209 | + | |
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
208 | | - | |
209 | | - | |
| 213 | + | |
210 | 214 | | |
211 | 215 | | |
212 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
125 | 128 | | |
126 | | - | |
127 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
128 | 132 | | |
129 | 133 | | |
130 | 134 | | |
| |||
0 commit comments