diff options
| author | Damien George <damien@micropython.org> | 2022-05-26 10:51:29 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-06-07 13:19:55 +1000 |
| commit | b37b57821476d9ea80cdcc89d325dcabded3ffb7 (patch) | |
| tree | 8be44de48aeb5b1be95a163d2bd9e20289c75c9e /tools/mpy-tool.py | |
| parent | 2111ca0b8fdcbef6177a8d37fde53085de2a798a (diff) | |
py/persistentcode: Remove remaining native qstr linking support.
Support for architecture-specific qstr linking was removed in
d4d53e9e114d779523e382c4ea38f0398e880aae, where native code was changed to
access qstr values via qstr_table. The only remaining use for the special
qstr link table in persistentcode.c is to support native module written in
C, linked via mpy_ld.py. But native modules can also use the standard
module-level qstr_table (and obj_table) which was introduced in the .mpy
file reworking in f2040bfc7ee033e48acef9f289790f3b4e6b74e5.
This commit removes the remaining native qstr liking support in
persistentcode.c's load_raw_code function, and adds two new relocation
options for constants.qstr_table and constants.obj_table. mpy_ld.py is
updated to use these relocations options instead of the native qstr link
table.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tools/mpy-tool.py')
| -rwxr-xr-x | tools/mpy-tool.py | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py index 6a22f5a40..20ccc87d4 100755 --- a/tools/mpy-tool.py +++ b/tools/mpy-tool.py @@ -976,7 +976,6 @@ class RawCodeNative(RawCode): kind, fun_data, prelude_offset, - qstr_links, scope_flags, n_pos_args, type_sig, @@ -989,7 +988,6 @@ class RawCodeNative(RawCode): self.scope_flags = scope_flags self.n_pos_args = n_pos_args - self.qstr_links = qstr_links self.type_sig = type_sig if config.native_arch in ( MP_NATIVE_ARCH_X86, @@ -1196,15 +1194,6 @@ def read_raw_code(reader, cm_escaped_name, qstr_table, obj_table, segments): rc = RawCodeBytecode(cm_escaped_name, qstr_table, obj_table, fun_data) else: # Create native raw code. - qstr_links = [] - if kind in (MP_CODE_NATIVE_PY, MP_CODE_NATIVE_VIPER): - # Read qstr link table. - n_qstr_link = reader.read_uint() - for _ in range(n_qstr_link): - off = reader.read_uint() - qst = read_qstr(reader, segments) - qstr_links.append((off >> 2, off & 3, qst)) - native_scope_flags = 0 native_n_pos_args = 0 native_type_sig = 0 @@ -1242,7 +1231,6 @@ def read_raw_code(reader, cm_escaped_name, qstr_table, obj_table, segments): kind, fun_data, prelude_offset, - qstr_links, native_scope_flags, native_n_pos_args, native_type_sig, |
