Without this calls to DSO-local but weakly defined symbols will be
direct calls even though at runtime another DLL could define that
symbol.
Fixes: https://github.com/emscripten-core/emscripten/issues/13773
Paths
| Differential D108060
WIP: [WebAssembly] Always use call_indirect when calling interposable functions Needs ReviewPublic Authored by sbc100 on Aug 13 2021, 4:05 PM.
Details
Summary Without this calls to DSO-local but weakly defined symbols will be Fixes: https://github.com/emscripten-core/emscripten/issues/13773
Diff Detail
Event TimelineHerald added subscribers: wingo, ecnelises, sunfish and 3 others. · View Herald TranscriptAug 13 2021, 4:05 PM sbc100 retitled this revision from [WebAssembly] Always use call_indirect when calling interposable functions to WIP: [WebAssembly] Always use call_indirect when calling interposable functions.Aug 13 2021, 4:05 PM Comment ActionsStill needs a test.. but this fixes the emscripten issue. Comment Actions when is Func->isInterposable() true? Is it just for weakly-defined functions (unlike e.g. in ELF where it's true anytime it's not DSO-local?) Comment Actions
Ah good point.. my goal here is to got call_indirect (via GOT) for weakly defined functions, but we might not want to do this for all externally visible symbols (or when calling imported functions).
Revision Contents
Diff 366367 llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/test/CodeGen/WebAssembly/call-pic.ll
|