[PATCH] D112833: [lld][WebAssembly] Generate TLS relocation code also when linking statically

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 29 10:06:36 PDT 2021


sbc100 created this revision.
Herald added subscribers: wingo, ecnelises, sunfish, jgravelle-google, dschuff.
sbc100 requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112833

Files:
  lld/test/wasm/pie.ll
  lld/test/wasm/tls-non-shared-memory.s
  lld/test/wasm/tls.s
  lld/wasm/SyntheticSections.cpp
  lld/wasm/SyntheticSections.h
  lld/wasm/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112833.383412.patch
Type: text/x-patch
Size: 8243 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211029/c86ee9a3/attachment.bin>


More information about the llvm-commits mailing list