diff options
| author | Luuk de Gram <luuk@degram.dev> | 2022-05-26 16:25:26 +0200 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2022-06-24 08:12:17 +0200 |
| commit | 16daf3f3bcb27b2e0b0f45ee48c69824a4804981 (patch) | |
| tree | 20d218d50128c1cbf3ecb09fa59dab44fcc02e57 /src/link/Wasm/Atom.zig | |
| parent | 1a3f58f5e56ad166eb5441c6960a8fac36b4ff5f (diff) | |
| download | zig-16daf3f3bcb27b2e0b0f45ee48c69824a4804981.tar.gz zig-16daf3f3bcb27b2e0b0f45ee48c69824a4804981.zip | |
wasm-link: Discard old symbols correctly
When a new symbol is resolved to an existing symbol where
it doesn't overwrite the existing symbol, we now add this symbol
to the discarded list. This is required so when any relocation points
to the symbol, we can retrieve the correct symbol it's resolved by instead.
Diffstat (limited to 'src/link/Wasm/Atom.zig')
| -rw-r--r-- | src/link/Wasm/Atom.zig | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/link/Wasm/Atom.zig b/src/link/Wasm/Atom.zig index edef52004d..588a9a3edd 100644 --- a/src/link/Wasm/Atom.zig +++ b/src/link/Wasm/Atom.zig @@ -147,7 +147,6 @@ pub fn resolveRelocs(self: *Atom, wasm_bin: *const Wasm) void { fn relocationValue(self: Atom, relocation: types.Relocation, wasm_bin: *const Wasm) u64 { const target_loc: Wasm.SymbolLoc = .{ .file = self.file, .index = relocation.index }; const symbol = target_loc.getSymbol(wasm_bin).*; - switch (relocation.relocation_type) { .R_WASM_FUNCTION_INDEX_LEB => return symbol.index, .R_WASM_TABLE_NUMBER_LEB => return symbol.index, |
