llvm-project/lld/wasm
Sam Clegg 59f959ff33 [WebAssembly] Relax signature checking for undefined functions that are not called directly
When function signatures don't match and the undefined function is not
called directly (i.e. only has its address taken) we don't issue a
warning or create a runtime thunk for the undefined function.

Instead in this case we simply use the defined version of the function.
This is possible since checking signatures of dynamic calls happens
at runtime so any invalid usage will still result in a runtime error.

This is needed to allow C++ programs to link without generating
warnings.  Its not uncommon in C++ for vtables to be populated by
function address whee the signature of the function is not known in the
compilation unit.  In this case clang declares the method as void(void)
and relies on the vtable caller casting the data back to the correct
signature.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=40412

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

llvm-svn: 361678
2019-05-24 22:45:08 +00:00
..
CMakeLists.txt [WebAssembly] Refactor synthetic sections and relocation processing. NFC. 2019-05-21 09:13:09 +00:00
Config.h [WebAssembly] Add support for -emit-relocs 2019-05-24 13:28:27 +00:00
Driver.cpp [WebAssembly] Relax signature checking for undefined functions that are not called directly 2019-05-24 22:45:08 +00:00
InputChunks.cpp [WebAssembly] Always take into account added when applying runtime relocations 2019-04-25 17:11:54 +00:00
InputChunks.h [WebAssembly] Refactor synthetic sections and relocation processing. NFC. 2019-05-21 09:13:09 +00:00
InputEvent.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InputFiles.cpp [WebAssembly] Relax signature checking for undefined functions that are not called directly 2019-05-24 22:45:08 +00:00
InputFiles.h [WebAssembly] Relax signature checking for undefined functions that are not called directly 2019-05-24 22:45:08 +00:00
InputGlobal.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LTO.cpp [WebAssebmly] Add support for --wrap 2019-05-24 14:14:25 +00:00
LTO.h [WebAssembly] Support imports from custom module names 2019-02-01 02:29:57 +00:00
MarkLive.cpp [WebAssembly] Apply data relocations at runtime in shared objects 2019-04-04 18:40:51 +00:00
MarkLive.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Options.td [WebAssebmly] Add support for --wrap 2019-05-24 14:14:25 +00:00
OutputSections.cpp [WebAssembly] Refactor synthetic sections and relocation processing. NFC. 2019-05-21 09:13:09 +00:00
OutputSections.h [WebAssembly] Refactor synthetic sections and relocation processing. NFC. 2019-05-21 09:13:09 +00:00
OutputSegment.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Relocations.cpp [WebAssembly] Refactor synthetic sections and relocation processing. NFC. 2019-05-21 09:13:09 +00:00
Relocations.h [WebAssembly] Refactor synthetic sections and relocation processing. NFC. 2019-05-21 09:13:09 +00:00
SymbolTable.cpp [WebAssembly] Relax signature checking for undefined functions that are not called directly 2019-05-24 22:45:08 +00:00
SymbolTable.h [WebAssembly] Relax signature checking for undefined functions that are not called directly 2019-05-24 22:45:08 +00:00
Symbols.cpp [lld] Trace all references with lld --trace-symbol 2019-05-24 13:29:17 +00:00
Symbols.h [WebAssembly] Relax signature checking for undefined functions that are not called directly 2019-05-24 22:45:08 +00:00
SyntheticSections.cpp [WebAssembly] Seal imports section before counting imports 2019-05-23 09:41:03 +00:00
SyntheticSections.h [WebAssembly] Add support for -emit-relocs 2019-05-24 13:28:27 +00:00
Writer.cpp [WebAssembly] Add support for -emit-relocs 2019-05-24 13:28:27 +00:00
Writer.h [WebAssembly] Refactor synthetic sections and relocation processing. NFC. 2019-05-21 09:13:09 +00:00
WriterUtils.cpp [wasm] Simplify. NFC 2019-04-18 13:33:29 +00:00
WriterUtils.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00