aboutsummaryrefslogtreecommitdiff
path: root/src/link/Wasm/Atom.zig
diff options
context:
space:
mode:
authorLuuk de Gram <luuk@degram.dev>2022-02-21 21:43:38 +0100
committerLuuk de Gram <luuk@degram.dev>2022-02-23 16:07:36 +0100
commitacec06cfaf9a82ec8037a23993ff36fa72eb6e82 (patch)
tree6fbabbcf1bedaf2b46ee42c170f187c2a34648f5 /src/link/Wasm/Atom.zig
parent0a48a763fd3548a7b8609555cecbafc21ebe1fc3 (diff)
downloadzig-acec06cfaf9a82ec8037a23993ff36fa72eb6e82.tar.gz
zig-acec06cfaf9a82ec8037a23993ff36fa72eb6e82.zip
wasm-linker: Implement `updateDeclExports`
We now correctly implement exporting decls. This means it is possible to export a decl with a different name than the decl that is doing the export. This also sets the symbols with the correct flags, so when we emit a relocatable object file, a linker can correctly resolve symbols and/or export the symbol to the host environment. This commit also includes fixes to ensure relocations have the correct offset to how other linkers will expect the offset, rather than what we use internally. Other linkers accept the offset, relative to the section. Internally we use an offset relative to the atom.
Diffstat (limited to 'src/link/Wasm/Atom.zig')
-rw-r--r--src/link/Wasm/Atom.zig1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/link/Wasm/Atom.zig b/src/link/Wasm/Atom.zig
index 151f6a7f6a..683a18ba1f 100644
--- a/src/link/Wasm/Atom.zig
+++ b/src/link/Wasm/Atom.zig
@@ -173,7 +173,6 @@ fn relocationValue(self: Atom, relocation: types.Relocation, wasm_bin: *const Wa
if (symbol.isUndefined() and (symbol.tag == .data or symbol.isWeak())) {
return 0;
}
-
const merge_segment = wasm_bin.base.options.output_mode != .Obj;
const segment_name = wasm_bin.segment_info.items[symbol.index].outputName(merge_segment);
const atom_index = wasm_bin.data_segments.get(segment_name).?;