[PATCH] D92038: [lld][WebAssebmly] Ensure stub symbols always get address 0

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 08:21:20 PST 2020


sbc100 created this revision.
Herald added subscribers: llvm-commits, wingo.
Herald added a project: LLVM.
sbc100 requested review of this revision.
Herald added a subscriber: aheejin.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92038

Files:
  lld/test/wasm/weak-undefined-pic.s
  lld/wasm/MarkLive.cpp
  lld/wasm/Relocations.cpp
  lld/wasm/SymbolTable.cpp
  lld/wasm/Symbols.h
  lld/wasm/SyntheticSections.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92038.307370.patch
Type: text/x-patch
Size: 5605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201124/d90a673e/attachment-0001.bin>


More information about the llvm-commits mailing list