aboutsummaryrefslogtreecommitdiff
path: root/src/link/Wasm.zig
AgeCommit message (Collapse)Author
2025-01-15wasm linker: implement `@tagName` functions when tags are autoassignedAndrew Kelley
2025-01-15wasm linker: don't crash on ref to voidAndrew Kelley
2025-01-15wasm-linker: add updateFunc logAndrew Kelley
2025-01-15wasm linker: fix corruption of string bytesAndrew Kelley
if any fixups are emitted in lowering data, keep the string bytes allocated even if all zeroes because it is used as a fixup staging area.
2025-01-15wasm linker: handle function data references properlyAndrew Kelley
2025-01-15wasm linker: don't call init functions unless object includedAndrew Kelley
2025-01-15implement indirect function table for object functionsAndrew Kelley
2025-01-15wasm linker: handle weak globals in relocsAndrew Kelley
2025-01-15wasm linker: don't try to lower nav zcu data before updateNav is calledAndrew Kelley
2025-01-15wasm linker: don't assume nav callees are fully resolvedAndrew Kelley
codegen can be called which contains calls to navs which have only their type resolved. this means the indirect function table needs to track nav indexes not ip indexes.
2025-01-15wasm linker: distinguish symbol name vs import name, and implement weakAndrew Kelley
2025-01-15wasm linker: fix not merging object memoriesAndrew Kelley
2025-01-15fix merge conflicts with updating line numbersAndrew Kelley
2025-01-15wasm linker: implement data relocsAndrew Kelley
2025-01-15wasm linker: implement data symbolsAndrew Kelley
2025-01-15wasm linker: implement __wasm_call_ctorsAndrew Kelley
2025-01-15implement function relocationsAndrew Kelley
not all relocation types are implemented yet
2025-01-15type checking for synthetic functionsAndrew Kelley
2025-01-15wasm object parsing: fix handling of weak functions and globalsAndrew Kelley
2025-01-15wasm linker: improve error messages by making source locations more lazyAndrew Kelley
2025-01-15wasm linker: chase relocations for referencesAndrew Kelley
2025-01-15fix bad archive name calculationAndrew Kelley
2025-01-15resolve merge conflictsAndrew Kelley
with 497592c9b45a94fb7b6028bf45b80f183e395a9b
2025-01-15wasm linker: fix crashes when parsing compiler_rtAndrew Kelley
2025-01-15wasm linker: fix relocation parsingAndrew Kelley
2025-01-15wasm linker: fix missing function type entry for importAndrew Kelley
2025-01-15wasm linker: implement indirect function callsAndrew Kelley
2025-01-15wasm linker: implement stack pointer globalAndrew Kelley
2025-01-15wasm linker: fix data section in flushAndrew Kelley
2025-01-15implement error table and error names data segmentsAndrew Kelley
2025-01-15wasm linker: initialize the data segments table in flushAndrew Kelley
it cannot be done earlier since ids are not stable yet
2025-01-15wasm linker: also call lowerZcuData in updateFuncAndrew Kelley
codegen can generate zcu data dependencies that need to be populated
2025-01-15wasm linker: avoid recursion in lowerZcuDataAndrew Kelley
instead of recursion, callers of the function are responsible for checking the respective tables that might have new entries in them and then calling lowerZcuData again.
2025-01-15wasm linker: implement data fixupsAndrew Kelley
one hash table lookup per fixup
2025-01-15wasm linker: fix eliding empty data segmentsAndrew Kelley
2025-01-15wasm linker: allow undefined imports when lib name is providedAndrew Kelley
and expose object_host_name as an option for setting the lib name for object files, since the wasm linking standards don't specify a way to do it.
2025-01-15wasm linker: handle extern functions in updateNavAndrew Kelley
2025-01-15wasm linker: fix data segments memory flowAndrew Kelley
Recognize three distinct phases: * before prelink ("object phase") * after prelink, before flush ("zcu phase") * during flush ("flush phase") With this setup, we create data structures during the object phase, then mutate them during the zcu phase, and then further mutate them during the flush phase. In order to make the flush phase repeatable, the data structures are copied just before starting the flush phase. Further Zcu updates occur against the non-copied data structures. What's not implemented is frontend garbage collection, in which case some more changes will be needed in this linker logic to achieve a valid state with data invariants intact.
2025-01-15wasm linker: fix calling imported functionsAndrew Kelley
and more disciplined type safety for output function indexes
2025-01-15add safety for calling functions that get virtual addrsAndrew Kelley
2025-01-15fix calculation of nav alignmentAndrew Kelley
2025-01-15complete wasm.Emit implementationAndrew Kelley
2025-01-15wasm linker: implement missing logicAndrew Kelley
fix some compilation errors for reworked Emit now that it's actually referenced introduce DataSegment.Id for sorting data both from object files and from the Zcu. introduce optimization: data segment sorting includes a descending sort on reference count so that references to data can be smaller integers leading to better LEB encodings. this optimization is skipped for object files. implement uav address access function which is based on only 1 hash table lookup to find out the offset after sorting.
2025-01-15wasm linker: implement type index methodAndrew Kelley
2025-01-15wasm linker: implement name subsectionAndrew Kelley
unlike the previous implementation, we can simply iterate an array.
2025-01-15wasm linker fixesAndrew Kelley
* function resolution now links to zcu_funcs, not navs_exe/navs_obj * updateFunc now adds things to output functions * updateNav now handles function aliases correctly * only report start symbol missing when it is unresolved
2025-01-15fix compilation when enabling llvmAndrew Kelley
2025-01-15wasm linker: finish the flush functionAndrew Kelley
This branch is passing type checking now.
2025-01-15wasm linker: flush export sectionAndrew Kelley
2025-01-15wasm linker: flush implemented up to the export sectionAndrew Kelley