summaryrefslogtreecommitdiff
path: root/tools/mpy_ld.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-12-16 21:53:43 +1100
committerDamien George <damien.p.george@gmail.com>2019-12-17 13:22:11 +1100
commit0bd7d1f7f03d086a0789caa8e007cf15068c689c (patch)
tree765050a94427ad391ca1bc7cd8de5ab520ffc13a /tools/mpy_ld.py
parent04e7aa056316d7b4400b508caefe26c6b75384f8 (diff)
py/persistentcode: Move loading of rodata/bss to before obj/raw-code.
This makes the loading of viper-code-with-relocations a bit neater and easier to understand, by treating the rodata/bss like a special object to be loaded into the constant table (which is how it behaves).
Diffstat (limited to 'tools/mpy_ld.py')
-rwxr-xr-xtools/mpy_ld.py16
1 files changed, 1 insertions, 15 deletions
diff --git a/tools/mpy_ld.py b/tools/mpy_ld.py
index ec600f967..31c391299 100755
--- a/tools/mpy_ld.py
+++ b/tools/mpy_ld.py
@@ -765,14 +765,6 @@ class MPYOutput:
self.write_uint(len(s) << 1)
self.write_bytes(s)
- def write_obj(self, o):
- if o is Ellipsis:
- self.write_bytes(b'e')
- return
- else:
- # Other Python types not implemented
- assert 0
-
def write_reloc(self, base, offset, dest, n):
need_offset = not (base == self.prev_base and offset == self.prev_offset + 1)
self.prev_offset = offset + n - 1
@@ -845,17 +837,11 @@ def build_mpy(env, entry_offset, fmpy, native_qstr_vals, native_qstr_objs):
out.write_uint(scope_flags)
# MPY: n_obj
- out.write_uint(bool(len(env.full_rodata)) + bool(len(env.full_bss)))
+ out.write_uint(0)
# MPY: n_raw_code
out.write_uint(0)
- # MPY: optional bytes object with rodata
- if len(env.full_rodata):
- out.write_obj(Ellipsis)
- if len(env.full_bss):
- out.write_obj(Ellipsis)
-
# MPY: rodata and/or bss
if len(env.full_rodata):
rodata_const_table_idx = 1