From b8d959d6cf6afab4277a7e094be5107f27105b17 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 14 Apr 2022 14:02:09 +1000 Subject: [PATCH] Revert "py/emitnative: Don't store prelude at end of machine code if..." This reverts commit 7e8222ae063d78ae8f901bb0f9fef663edd2edb6. 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 --- py/emitnative.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/py/emitnative.c b/py/emitnative.c index 2863984047..056a1a8a61 100644 --- a/py/emitnative.c +++ b/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,