tools/mpy_ld.py: Support more complex rodata sections.
Sections sometimes named .rodata.str1.1 etc, instead of just .rodata. Avoid crashing in that case. Instead treat it like any other RO section. Fix thanks to @phlash. Fixes issue #8783. Signed-off-by: Jon Nordby <jononor@gmail.com>
This commit is contained in:
parent
d1f288c041
commit
4837ec336a
|
@ -972,7 +972,7 @@ def build_mpy(env, entry_offset, fmpy, native_qstr_vals, native_qstr_objs):
|
||||||
for base, addr, kind in env.mpy_relocs:
|
for base, addr, kind in env.mpy_relocs:
|
||||||
if isinstance(kind, str) and kind.startswith(".text"):
|
if isinstance(kind, str) and kind.startswith(".text"):
|
||||||
kind = 0
|
kind = 0
|
||||||
elif kind in (".rodata", ".data.rel.ro"):
|
elif isinstance(kind, str) and kind.startswith((".rodata", ".data.rel.ro")):
|
||||||
if env.arch.separate_rodata:
|
if env.arch.separate_rodata:
|
||||||
kind = rodata_const_table_idx
|
kind = rodata_const_table_idx
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue