]>
git.proxmox.com Git - wasi-libc.git/blob - libc-bottom-half/crt/crt1.c
b3906dc5f36ced774262b3952ab75d2ab9a0cb9f
2 extern void __wasm_call_ctors(void);
3 extern int __main_void(void);
4 extern void __wasm_call_dtors(void);
6 __attribute__((export_name("_start")))
8 // The linker synthesizes this to call constructors.
11 // Call `__main_void` which will either be the application's zero-argument
12 // `__main_void` function or a libc routine which obtains the command-line
13 // arguments and calls `__main_argv_argc`.
14 int r
= __main_void();
16 // Call atexit functions, destructors, stdio cleanup, etc.
19 // If main exited successfully, just return, otherwise call
20 // `__wasi_proc_exit`.