bjorn3 opened PR #15231 from bjorn3:fix_jit_got_relocs to bytecodealliance:main:
Previously addends for GOT relocations were interpreted as applying to the address of the target symbol, with a + 4 to correct for the bogus result and an explicit - 4 for determining the pcrel offset. The addend should instead be applied to the pcrel offset and ignored for the GOT value. This ensures addends other than -4 are correctly interpreted and prevents a panic for symbol addresses < 4 (eg when storing a constant directly in the symbol rather than a pointer to said constant)
Additionally stop hard coding the GOT size as 8 bytes big. If we get 32bit support in the future, the GOT should be 4 bytes big.
I noticed this while trying to add TLS support to cranelift-jit and noticing I got a panic whenever I tried to store an id for the TLS slot directly in the GOT entry as if it is the address of the TLS symbol.
bjorn3 removed the review request for wasmtime-compiler-reviewers from PR #15231.
bjorn3 requested wasmtime-compiler-reviewers for a review on PR #15231.
bjorn3 requested cfallin for a review on PR #15231.
github-actions[bot] added the label cranelift on PR #15231.
:thumbs_up: cfallin submitted PR review:
Thanks!
cfallin added PR #15231 Fix handling of GOT relocations in cranelift-jit to the merge queue.
:check: cfallin merged PR #15231.
cfallin removed PR #15231 Fix handling of GOT relocations in cranelift-jit from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC