[PATCH] D91276: [WebAssembly] Add new relocation types for TLS data symbols

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 09:18:36 PST 2020


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

These relocations represent offsets from the __tls_base symbol.

Previously we were just using normal MEMORY_ADDR relocations and relying
on the linker to select a segment-offset rather and absolute value in
Symbol::getVirtualAddress().  Using an explicit relocation type allows
allow us to clearly distingish absolute from relative relocations based
on the relocation information alone.

One place this is usefull is being able to reject absolute relocation in
the PIC case, but still accept TLS relocations.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91276

Files:
  lld/test/wasm/relocation-bad-tls.s
  lld/test/wasm/tls.s
  lld/wasm/InputChunks.cpp
  lld/wasm/InputFiles.cpp
  lld/wasm/OutputSections.cpp
  lld/wasm/Relocations.cpp
  lld/wasm/Symbols.cpp
  lld/wasm/Writer.cpp
  llvm/include/llvm/BinaryFormat/WasmRelocs.def
  llvm/include/llvm/MC/MCExpr.h
  llvm/lib/BinaryFormat/Wasm.cpp
  llvm/lib/MC/MCExpr.cpp
  llvm/lib/MC/WasmObjectWriter.cpp
  llvm/lib/Object/WasmObjectFile.cpp
  llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
  llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
  llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.h
  llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
  llvm/test/CodeGen/WebAssembly/tls-general-dynamic.ll
  llvm/test/CodeGen/WebAssembly/tls-local-exec.ll
  llvm/test/MC/WebAssembly/tls.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91276.304542.patch
Type: text/x-patch
Size: 22381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201111/fea7c3f7/attachment.bin>


More information about the llvm-commits mailing list