port(wasm): Support --export of linker-defined symbols - #2414
Open
lapla-cogito wants to merge 3 commits into
Open
port(wasm): Support --export of linker-defined symbols#2414lapla-cogito wants to merge 3 commits into
--export of linker-defined symbols#2414lapla-cogito wants to merge 3 commits into
Conversation
| continue; | ||
| } | ||
| match sym { | ||
| WasmLinkerSymbol::CallCtors => needs_ctors = true, |
Member
There was a problem hiding this comment.
Isn't this repeating logic that already exists elsewhere? Any idea how to deduplicate?
| let global = layout.globals.get_mut(defined_slot).ok_or_else(|| { | ||
| crate::error!("exported data global slot {defined_slot} out of range") | ||
| })?; | ||
| let addr_i32 = i32::try_from(addr).map_err(|_| { |
Member
There was a problem hiding this comment.
Why are addresses encoded as i32 rather than u32? Seems surprising. Could it ever make sense for a negative value?
| fn requested_linker_export_symbols(args: &WasmArgs) -> Vec<WasmLinkerSymbol> { | ||
| let mut symbols = Vec::new(); | ||
| for name in args.force_export_symbol_names() { | ||
| let Some(sym) = WasmLinkerSymbol::parse(name) else { |
Member
There was a problem hiding this comment.
It seems odd to me that we're parsing the symbol name both here and in ensure_force_exports. Do we need to do both?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Look up linker-synthesized symbols for
--export/--export-if-definedand materialize them.Fixes #2334
Part of #1431