[all-commits] [llvm/llvm-project] 633938: [WebAssembly] Add support for table linking to was...

Andy Wingo via All-commits all-commits at lists.llvm.org
Mon Jan 18 07:59:54 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 63393828078c382e8e69d9b8146372b70bbce20f
      https://github.com/llvm/llvm-project/commit/63393828078c382e8e69d9b8146372b70bbce20f
  Author: Andy Wingo <wingo at igalia.com>
  Date:   2021-01-18 (Mon, 18 Jan 2021)

  Changed paths:
    M lld/test/wasm/alias.s
    A lld/test/wasm/export-table-explicit.test
    M lld/test/wasm/init-fini.ll
    M lld/test/wasm/local-symbols.ll
    M lld/test/wasm/locals-duplicate.test
    M lld/test/wasm/pie.ll
    M lld/test/wasm/section-symbol-relocs.yaml
    M lld/test/wasm/shared.ll
    M lld/test/wasm/signature-mismatch.ll
    M lld/test/wasm/stack-pointer.ll
    M lld/test/wasm/weak-alias.ll
    M lld/wasm/Driver.cpp
    M lld/wasm/InputFiles.cpp
    M lld/wasm/InputFiles.h
    M lld/wasm/MarkLive.cpp
    M lld/wasm/SymbolTable.cpp
    M lld/wasm/SymbolTable.h
    M lld/wasm/Symbols.cpp
    M lld/wasm/Symbols.h
    M lld/wasm/SyntheticSections.cpp
    M lld/wasm/SyntheticSections.h
    M lld/wasm/Writer.cpp

  Log Message:
  -----------
  [WebAssembly] Add support for table linking to wasm-ld

This patch adds support to wasm-ld for linking multiple table references
together, in a manner similar to wasm globals. The indirect function
table is synthesized as needed.

To manage the transitional period in which the compiler doesn't yet
produce TABLE_NUMBER relocations and doesn't residualize table symbols,
the linker will detect object files which have table imports or
definitions, but no table symbols. In that case it will synthesize
symbols for the defined and imported tables.

As a change, relocatable objects are now written with table symbols,
which can cause symbol renumbering in some of the tests. If no object
file requires an indirect function table, none will be written to the
file. Note that for legacy ObjFile inputs, this test is conservative: as
we don't have relocs for each use of the indirecy function table, we
just assume that any incoming indirect function table should be
propagated to the output.

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


  Commit: d806618636f8a82bfc3f620e1fad83af4d2a2575
      https://github.com/llvm/llvm-project/commit/d806618636f8a82bfc3f620e1fad83af4d2a2575
  Author: Andy Wingo <wingo at igalia.com>
  Date:   2021-01-18 (Mon, 18 Jan 2021)

  Changed paths:
    M llvm/lib/MC/WasmObjectWriter.cpp
    M llvm/test/MC/WebAssembly/debug-info.ll
    M llvm/test/MC/WebAssembly/debug-info64.ll
    M llvm/test/MC/WebAssembly/function-alias.ll
    M llvm/test/MC/WebAssembly/global-ctor-dtor.ll
    M llvm/test/MC/WebAssembly/reloc-pic.s
    M llvm/test/MC/WebAssembly/type-index.s
    M llvm/test/MC/WebAssembly/weak-alias.s

  Log Message:
  -----------
  [WebAssembly] MC layer writes table symbols to object files

Now that the linker handles table symbols, we can allow the frontend to
produce them.

Depends on D91870.

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


Compare: https://github.com/llvm/llvm-project/compare/ce06475da94f...d806618636f8


More information about the All-commits mailing list