[all-commits] [llvm/llvm-project] 48ddf5: [lld][WebAssembly] Ensure stub symbols always get ...

Sam Clegg via All-commits all-commits at lists.llvm.org
Wed Nov 25 18:31:20 PST 2020


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

  Changed paths:
    A lld/test/wasm/weak-undefined-pic.s
    M lld/wasm/Driver.cpp
    M lld/wasm/MarkLive.cpp
    M lld/wasm/Relocations.cpp
    M lld/wasm/SymbolTable.cpp
    M lld/wasm/Symbols.h
    M lld/wasm/SyntheticSections.cpp

  Log Message:
  -----------
  [lld][WebAssembly] Ensure stub symbols always get address 0

Without this extra flag we can't distingish between stub functions and
functions that happen to have address 0 (relative to __table_base).

Adding this flag bit the base symbol class actually avoids growing the
SymbolUnion struct which would not be true if we added it to the
FunctionSymbol subclass (due to bitbacking).

The previous approach of setting it's table index to zero worked for
normal static relocations but not for `-fPIC` code.

See https://github.com/emscripten-core/emscripten/issues/12819

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




More information about the All-commits mailing list