commit | 4db3ce988937ee31d366bab68d48295bc2d4f8c8 | [log] [tgz] |
---|---|---|
author | Teresa Johnson <tejohnson@google.com> | Sun Feb 14 17:48:34 2021 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Fri Feb 19 01:10:46 2021 -0800 |
tree | 8e309044f372970b17663da398f3862057b26136 | |
parent | b85236eedf15924942d42ac3141c11eb4fc3cb01 [diff] |
[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 GitOrigin-RevId: 3c4c205060c9398da705eb71b63ddd8a04999de9
This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.
lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.
In order to make sure various developers can evaluate patches over the same tests, we create a collection of self contained programs.
It is hosted at https://s3-us-west-2.amazonaws.com/linker-tests/lld-speed-test.tar.xz
The current sha256 is 10eec685463d5a8bbf08d77f4ca96282161d396c65bd97dc99dbde644a31610f
.