Skip to content

wasm-linker: fix storing atoms in the correct segment #14838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 19, 2023

Conversation

Luukdegram
Copy link
Contributor

Closes #14834

When a decl is `undefined` is must be stored in the data segment when
the build mode is safe. For unsafe optimize modes, it must be stored
in the bss segment instead.

For mutable decls where the atom contains all zeroes, it must always
be stored in the bss segment. All other values will result in the
atom being stored in the data segment.
Updates the linker test to verify the various cases where we must
store the data in the bss segment.
@Luukdegram Luukdegram merged commit 322ace7 into ziglang:master Mar 19, 2023
@Luukdegram Luukdegram deleted the bss-fix branch March 19, 2023 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wasm linker lowers undefined and 0 incorrectly with respect to the bss section
1 participant