Browse Source

Revert "py/emitnative: Don't store prelude at end of machine code if..."

This reverts commit 7e8222ae06.

The prelude data must exist somewhere in the native code so load_raw_code
and mpy-tool.py can access and parse it.

Signed-off-by: Damien George <damien@micropython.org>
pull/8531/head
Damien George 3 years ago
parent
commit
b8d959d6cf
  1. 6
      py/emitnative.c

6
py/emitnative.c

@ -723,13 +723,7 @@ STATIC bool emit_native_end_pass(emit_t *emit) {
if (emit->pass == MP_PASS_EMIT) {
void *f = mp_asm_base_get_code(&emit->as->base);
#if N_PRELUDE_AS_BYTES_OBJ
// Keep only the machine code, not the prelude, which is in a separate bytes object.
mp_uint_t f_len = emit->prelude_offset;
#else
// Keep both the machine code and the prelude.
mp_uint_t f_len = mp_asm_base_get_code_size(&emit->as->base);
#endif
mp_emit_glue_assign_native(emit->scope->raw_code,
emit->do_viper_types ? MP_CODE_NATIVE_VIPER : MP_CODE_NATIVE_PY,

Loading…
Cancel
Save