[all-commits] [llvm/llvm-project] a28a46: [WebAssembly] Add new relocation type for TLS data...

Sam Clegg via All-commits all-commits at lists.llvm.org
Fri Nov 13 08:00:42 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a28a466210199559d38251c11f30515cc83eadd6
      https://github.com/llvm/llvm-project/commit/a28a466210199559d38251c11f30515cc83eadd6
  Author: Sam Clegg <sbc at chromium.org>
  Date:   2020-11-13 (Fri, 13 Nov 2020)

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

  Log Message:
  -----------
  [WebAssembly] Add new relocation type for TLS data symbols

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 distinguish absolute from relative relocations based
on the relocation information alone.

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

Differential Revision: https://reviews.llvm.org/D91276




More information about the All-commits mailing list