From 5e546668224fc8f1faad29d68c34a845d6d63077 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Mon, 15 Apr 2024 18:17:32 +0800 Subject: [PATCH] runtime_init: call cache::init before copying It is unclear why this reordering is useful--it should be the case that the previous content of the cache is invalidated on write regardless of when cache::init is called. --- runtime.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime.cpp b/runtime.cpp index 55a0fd7..facb95c 100644 --- a/runtime.cpp +++ b/runtime.cpp @@ -46,6 +46,8 @@ void copy(uint32_t * start, const uint32_t * end, uint32_t * load) extern "C" void runtime_init() { + cache::init(); + // relocate text (if necessary) copy(&__text_link_start, &__text_link_end, &__text_load_start); @@ -71,6 +73,4 @@ void runtime_init() while (start < end) { ((init_t*)(*start++))(); } - - cache::init(); }