From e7fa1dde9758e3fb75e011d112a9f56c5c20da48 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Tue, 30 Apr 2024 22:24:34 -0700 Subject: [PATCH] [ld.so] Mark main module to not run ctors Forgot to include this in the change for ld.so to run global ctors for all modules. The main module itself will have its ctors run last, by crt0, so mark it as not needing ctors in ld.so. --- src/user/ld.so/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/user/ld.so/main.cpp b/src/user/ld.so/main.cpp index 78d7d89..7e1909d 100644 --- a/src/user/ld.so/main.cpp +++ b/src/user/ld.so/main.cpp @@ -66,6 +66,7 @@ ldso_init(j6_arg_header *stack_args, uintptr_t *got) image_list::item_type target_image; target_image.base = arg_loader->image_base; target_image.got = arg_loader->got; + target_image.ctors = true; // crt0 will call the ctors target_image.read_dyn_table( reinterpret_cast(arg_loader->got[0] + arg_loader->image_base));