summaryrefslogtreecommitdiff
path: root/tools/mpy_ld.py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-03-25 13:10:12 +1100
committerDamien George <damien@micropython.org>2024-03-28 16:18:09 +1100
commitd2276f0d41c2fa66a224725fdb2411846c91cf1a (patch)
treee3f25bf47b4e8adfd5fd341819fded5457d961e4 /tools/mpy_ld.py
parent4662a71f44bd8a0f8ff96d12e43f69be3bff8488 (diff)
py/dynruntime: Add mp_binary_get_size/get_val_array/set_val_array.
These are needed to read/write array.array objects, which is useful in native code to provide fast extensions that work with big arrays of data. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tools/mpy_ld.py')
-rwxr-xr-xtools/mpy_ld.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/mpy_ld.py b/tools/mpy_ld.py
index d7d0b945c..b768b109a 100755
--- a/tools/mpy_ld.py
+++ b/tools/mpy_ld.py
@@ -52,6 +52,7 @@ MP_SCOPE_FLAG_VIPERRELOC = 0x10
MP_SCOPE_FLAG_VIPERRODATA = 0x20
MP_SCOPE_FLAG_VIPERBSS = 0x40
MP_SMALL_INT_BITS = 31
+MP_FUN_TABLE_MP_TYPE_TYPE_OFFSET = 70
# ELF constants
R_386_32 = 1
@@ -754,7 +755,7 @@ def link_objects(env, native_qstr_vals_len):
# Resolve unknown symbols
mp_fun_table_sec = Section(".external.mp_fun_table", b"", 0)
fun_table = {
- key: 67 + idx
+ key: MP_FUN_TABLE_MP_TYPE_TYPE_OFFSET + idx
for idx, key in enumerate(
[
"mp_type_type",