This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Generate TLS relocation code also when linking statically
ClosedPublic

Authored by sbc100 on Oct 29 2021, 10:06 AM.

Details

Summary

Previously relocations were only generated for PIC output, but
relocations for TLS GOT entries are always needed when shared
memory is enabled, not just in PIC mode.

This means that the __wasm_apply_global_tls_relocs is now
generated even for statically linked (non-PIC) output. Without
this the globals that hold the addresses of TLS symbols are
not set correctly.

Diff Detail

Event Timeline

sbc100 created this revision.Oct 29 2021, 10:06 AM
sbc100 requested review of this revision.Oct 29 2021, 10:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2021, 10:06 AM
sbc100 updated this revision to Diff 383440.Oct 29 2021, 11:23 AM
  • revert part
dschuff accepted this revision.Oct 29 2021, 12:11 PM
dschuff added inline comments.
lld/wasm/SyntheticSections.cpp
460
This revision is now accepted and ready to land.Oct 29 2021, 12:11 PM