aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ELFObjectFile.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2021-02-14 17:48:34 -0800
committerTeresa Johnson <tejohnson@google.com>2021-02-17 12:49:24 -0800
commit3c4c205060c9398da705eb71b63ddd8a04999de9 (patch)
tree13e4cfc5895c316a211c7087e1715a0cf8a2036d /llvm/lib/Object/ELFObjectFile.cpp
parente74191633036905388245818f54553813c880f83 (diff)
downloadllvm-3c4c205060c9398da705eb71b63ddd8a04999de9.zip
llvm-3c4c205060c9398da705eb71b63ddd8a04999de9.tar.gz
llvm-3c4c205060c9398da705eb71b63ddd8a04999de9.tar.bz2
[WPD][lld] Test handling of vtable definition from shared libraries
Adds a lld test for a case that the handling added for dynamically exported symbols in 1487747e990ce9f8851f3d92c3006a74134d7518 already fixes. Because isExportDynamic returns true when the symbol is SharedKind with default visibility, it will treat as dynamically exported and block devirtualization when the definition of a vtable comes from a shared library. This is desireable as it is dangerous to devirtualize in that case, since there could be hidden overrides in the shared library. Typically that happens when the shared library header contains available externally definitions, which applications can override. An example is std::error_category, which is overridden in LLVM and causing failures after a self build with WPD enabled, because libstdc++ contains hidden overrides of the virtual base class methods. The regular LTO case in the new test already worked, but there are 2 fixes in this patch needed for the index-only case and the hybrid LTO case. For the index-only case, WPD should not simply ignore available externally vtables. A follow on fix will be made to clang to emit type metadata for those vtables, which the new test is modeling. For the hybrid case, we need to ensure when the module is split that any llvm.*used globals are cloned to the regular LTO split module so available externally vtable definitions are not prematurely deleted. Another follow on fix will add the equivalent gold test, which requires a small fix to the plugin to treat symbols in dynamic libraries the same way lld already is. Differential Revision: https://reviews.llvm.org/D96721
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions