[WebAssembly] Don't generate unused table entries.
authorSam Clegg <sbc@chromium.org>
Tue, 7 May 2019 15:46:30 +0000 (15:46 +0000)
committerSam Clegg <sbc@chromium.org>
Tue, 7 May 2019 15:46:30 +0000 (15:46 +0000)
commitb33fdb7768e5de5fbeb23f65d8d455e7ca88b021
treee2aa89723f2a237383f8a92800cdbbbc06e24855
parent3044ac058bdc7ee960fb4c084d2f8affd2b9c8c4
[WebAssembly] Don't generate unused table entries.

When generating PIC output only relocations of type
R_WASM_TABLE_INDEX_REL_SLEB should generate table entries.

R_WASM_TABLE_INDEX_I32 get resolved at runtime via the auto-generated
__wasm_apply_relocs functions.

R_WASM_TABLE_INDEX_SLEB are not allowed in PIC code.

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

llvm-svn: 360165
lld/test/wasm/pie.ll
lld/test/wasm/shared.ll
lld/wasm/InputFiles.cpp
lld/wasm/Writer.cpp