Repository navigation
port(wasm): Apply shared-memory TLS template pointers per thread - #2733
Merged
Merged
Conversation
lapla-cogito
force-pushed
the
wasm_tls_template
branch
from
October 15, 2026 07:46
587d838 to
b8b9873
Compare
lapla-cogito
force-pushed
the
wasm_tls_template
branch
from
October 15, 2026 18:46
b8b9873 to
8822ea8
Compare
davidlattimore
approved these changes
Oct 16, 2026
| reject_tls_template_reloc(index_map, &reloc)?; | ||
| // The passive template is shared. Per-thread TLS pointers are stored by `__wasm_init_tls`. | ||
| if in_tls_template && deferred_tls_template_pointer(index_map, &reloc)?.is_some() { | ||
| return Ok(()); |
Member
There was a problem hiding this comment.
Note that this early return bypasses the "Wasm relocation slot out of range" check in apply_relocation. My inclination is that this probably isn't important, but I thought I'd mention it in case you decide that it does matter.
Member
Author
There was a problem hiding this comment.
I don't think it's important since that check guards the write into the template and this path does not write the slot.
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.
An
R_WASM_MEMORY_ADDR_I32in a shared-memory TLS template that targets a TLS symbol has no single address at link time. Leave that slot unchanged in the passive template and have__wasm_init_tlsstore__tls_base + displacementafter the copy.Part of #1431