summaryrefslogtreecommitdiff
path: root/tools/mpy_ld.py
diff options
context:
space:
mode:
authorJon Nordby <jononor@gmail.com>2023-07-30 15:40:39 +0200
committerDamien George <damien@micropython.org>2023-09-01 15:30:21 +1000
commit4837ec336a8047a1707534315f6b4b8aeac3f891 (patch)
tree19a2fdf322415fa34059a0d1927fc4b48b628b02 /tools/mpy_ld.py
parentd1f288c041c85793de17da9f8b38ff20af2a6f1d (diff)
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>
Diffstat (limited to 'tools/mpy_ld.py')
-rwxr-xr-xtools/mpy_ld.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/mpy_ld.py b/tools/mpy_ld.py
index 60fa41ce1..dd7b352b6 100755
--- a/tools/mpy_ld.py
+++ b/tools/mpy_ld.py
@@ -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:
if isinstance(kind, str) and kind.startswith(".text"):
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:
kind = rodata_const_table_idx
else: