Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libdyld: call _initialize as well #101

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions libdyld/dyld.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,19 @@ static const struct name name_main_object = NAME_FROM_CSTR_LITERAL("<main>");
*/
static const struct name init_funcs[] = {
NAME_FROM_CSTR_LITERAL("__wasm_apply_data_relocs"),
/*
* wasm-ld synthesizes __wasm_call_ctors.
*
* wasi reactor exec model uses _initialize as the entry point.
* crt1 provides _initialize, which calls __wasm_call_ctors.
* in that case, usually __wasm_call_ctors is not exported.
* cf. https://reviews.llvm.org/D156205
*
* otherwise, wasm-ld exports __wasm_call_ctors as it's
* the default entry point for -shared.
*/
NAME_FROM_CSTR_LITERAL("__wasm_call_ctors"),
NAME_FROM_CSTR_LITERAL("_initialize"),
};

static const struct val val_null = {
Expand Down