diff options
| author | Jon Nordby <jononor@gmail.com> | 2025-03-29 00:38:14 +0100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-04-03 16:37:38 +1100 |
| commit | 3805e65ed3b7306329bf0305d5b46f08d7619a11 (patch) | |
| tree | cfcd165019b2fe2346d25d4b56b3aaee902a24ab /tools | |
| parent | 6bb586619dc1b9022ca191016a3c32a6f89f3caa (diff) | |
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 #14430.
Signed-off-by: Jon Nordby <jononor@gmail.com>
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/mpy_ld.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/mpy_ld.py b/tools/mpy_ld.py index 44a76bdee..70cab2b89 100755 --- a/tools/mpy_ld.py +++ b/tools/mpy_ld.py @@ -702,9 +702,13 @@ def do_relocation_text(env, text_addr, r): elif env.arch.name == "EM_RISCV": (addr, value) = process_riscv32_relocation(env, text_addr, r) + elif env.arch.name == "EM_ARM" and r_info_type == R_ARM_ABS32: + # happens for soft-float on armv6m + raise ValueError("Absolute relocations not supported on ARM") + else: # Unknown/unsupported relocation - assert 0, r_info_type + assert 0, (r_info_type, s.name, s.entry, env.arch.name) # Write relocation if env.arch.name == "EM_RISCV": |
