Skip to content

Commit 3805e65

Browse files
jonnordpgeorge
authored andcommitted
tools/mpy_ld.py: Give better error for unsupported ARM absolute relocs.
This is a known limitation, so better to give a clear warning than a catch-all AssertionError. Happens for example when trying to use soft-float on ARCH=armv6m Also give more details on the assertion for unknown relocations, such that one can see which symbol it affects etc, to aid in debugging. References issue micropython#14430. Signed-off-by: Jon Nordby <[email protected]>
1 parent 6bb5866 commit 3805e65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/mpy_ld.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,13 @@ def do_relocation_text(env, text_addr, r):
702702
elif env.arch.name == "EM_RISCV":
703703
(addr, value) = process_riscv32_relocation(env, text_addr, r)
704704

705+
elif env.arch.name == "EM_ARM" and r_info_type == R_ARM_ABS32:
706+
# happens for soft-float on armv6m
707+
raise ValueError("Absolute relocations not supported on ARM")
708+
705709
else:
706710
# Unknown/unsupported relocation
707-
assert 0, r_info_type
711+
assert 0, (r_info_type, s.name, s.entry, env.arch.name)
708712

709713
# Write relocation
710714
if env.arch.name == "EM_RISCV":

0 commit comments

Comments
 (0)