diff options
| author | Luuk de Gram <luuk@degram.dev> | 2023-01-11 07:03:15 +0100 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2023-01-12 20:50:18 +0100 |
| commit | f8d1efd99ab0ff9ae49a17b437814f4fe329e83b (patch) | |
| tree | 411dca0d212597b6498098146a2429a75de04490 /src/link.zig | |
| parent | 1072f82acbe976222851bdd357f52dd9659d73d3 (diff) | |
| download | zig-f8d1efd99ab0ff9ae49a17b437814f4fe329e83b.tar.gz zig-f8d1efd99ab0ff9ae49a17b437814f4fe329e83b.zip | |
wasm-linker: implement __wasm_call_ctors symbol
This implements the `__wasm_call_ctors` symbol. This symbol is
automatically referenced by libc to initialize its constructors.
We first retrieve all constructors from each object file, and then
create a function body that calls each constructor based on its
priority. Constructors are not allowed to have any parameters, but are
allowed to have a return type. When a return type does exist, we simply
drop its value from the stack after calling the constructor to ensure
we pass the stack validator.
Diffstat (limited to 'src/link.zig')
| -rw-r--r-- | src/link.zig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/link.zig b/src/link.zig index 15bff217f0..2fb85cb482 100644 --- a/src/link.zig +++ b/src/link.zig @@ -716,6 +716,7 @@ pub const File = struct { InvalidFeatureSet, InvalidFormat, InvalidIndex, + InvalidInitFunc, InvalidMagicByte, InvalidWasmVersion, LLDCrashed, |
