From 6251dbda5d1f55f0a1c21952ac1731ae06cd0843 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 8 Dec 2025 14:03:00 +0100 Subject: [PATCH] Aarch64 patching fixed for R_AARCH64_LDST32_ABS_LO12_NC and R_AARCH64_LDST64_ABS_LO12_NC relocations --- src/copapy/_stencils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/copapy/_stencils.py b/src/copapy/_stencils.py index 75d16f0..1c57374 100644 --- a/src/copapy/_stencils.py +++ b/src/copapy/_stencils.py @@ -258,7 +258,7 @@ class stencil_database(): elif pr.type.endswith('_LDST32_ABS_LO12_NC'): # R_AARCH64_LDST32_ABS_LO12_NC # (S + A) & 0xFFF - mask = 0b11_1111_1111_1100_0000_0000 + mask = 0b00_1111_1111_1100_0000_0000 patch_value = symbol_address + pr.fields['r_addend'] symbol_type = symbol_type + 0x02 # Absolut value scale = 4 @@ -276,7 +276,7 @@ class stencil_database(): elif pr.type.endswith('_LDST64_ABS_LO12_NC'): # R_AARCH64_LDST64_ABS_LO12_NC # (S + A) & 0xFFF - mask = 0b11_1111_1111_1100_0000_0000 + mask = 0b00_0111_1111_1100_0000_0000 patch_value = symbol_address + pr.fields['r_addend'] symbol_type = symbol_type + 0x02 # Absolut value scale = 8