From 718ff4fdd58efd3e853599b489640877070d17be Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 28 May 2025 14:27:35 +1000 Subject: [PATCH] tools/mpy_ld.py: Support R_ARM_ABS32 relocation in text. Add support for R_ARM_ABS32 relocations in native .mpy files. These can be rewritten in the same way that data relocations are. Fixes issue #14430. Signed-off-by: Damien George --- tools/mpy_ld.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/mpy_ld.py b/tools/mpy_ld.py index 6518037f2e..a600ec12c3 100755 --- a/tools/mpy_ld.py +++ b/tools/mpy_ld.py @@ -711,8 +711,9 @@ def do_relocation_text(env, text_addr, r): (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") + # Absolute relocation, handled as a data relocation. + do_relocation_data(env, text_addr, r) + return else: # Unknown/unsupported relocation @@ -781,9 +782,9 @@ def do_relocation_data(env, text_addr, r): ): # Relocation in data.rel.ro to internal/external symbol if env.arch.word_size == 4: - struct_type = "