1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
Go to file
Reid Kleckner f53930f5f7 [COFF] Fix /export:foo=bar when bar is a weak alias
Summary:
When handling exports from the command line or from .def files, the
linker does a "fuzzy" string lookup to allow finding mangled symbols.
However, when the symbol is re-exported under a new name, the linker has
to transfer the decorations from the exported symbol over to the new
name. This is implemented by taking the mangled symbol that was found in
the object and replacing the original symbol name with the export name.

Before this patch, LLD implemented the fuzzy search by adding an
undefined symbol with the unmangled name, and then during symbol
resolution, checking if similar mangled symbols had been added after the
last round of symbol resolution. If so, LLD makes the original symbol a
weak alias of the mangled symbol. Later, to get the original symbol
name, LLD would look through the weak alias and forward it on to the
import library writer, which copies the symbol decorations. This
approach doesn't work when bar is itself a weak alias, as is the case in
asan. It's especially bad when the aliasee of bar contains the string
"bar", consider "bar_default". In this case, we would end up exporting
the symbol "foo_default" when we should've exported just "foo".

To fix this, don't look through weak aliases to find the mangled name.
Save the mangled name earlier during fuzzy symbol lookup.

Fixes PR42074

Reviewers: mstorsjo, ruiu

Subscribers: thakis, llvm-commits

Tags: #llvm

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

llvm-svn: 362849
2019-06-07 22:05:12 +00:00
benchmarks Pull google/benchmark library to the LLVM tree 2018-08-28 09:42:41 +00:00
bindings Fix bad go bindings test. 2019-05-31 03:45:11 +00:00
cmake Build with _XOPEN_SOURCE defined on AIX 2019-06-07 15:45:25 +00:00
docs [llvm-lipo] Add docs for llvm-lipo 2019-06-07 22:03:02 +00:00
examples Add a HowToUseLLJIT example project. 2019-05-22 21:38:41 +00:00
include [COFF] Fix /export:foo=bar when bar is a weak alias 2019-06-07 22:05:12 +00:00
lib [DomTreeUpdater] Add all insert before all delete updates to reduce compile time. 2019-06-07 20:43:55 +00:00
projects Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
resources
runtimes [CMake] Use libtool for runtimes when building for Apple platform 2019-06-02 02:05:01 +00:00
test [llvm-objdump] Fix Bugzilla ID 41862 to support checking addresses of disassembled object 2019-06-07 21:49:26 +00:00
tools [llvm-objdump] Fix Bugzilla ID 41862 to support checking addresses of disassembled object 2019-06-07 21:49:26 +00:00
unittests [ADT] Enable set_difference() to be used on StringSet 2019-06-07 20:23:03 +00:00
utils Fix string literals to avoid deprecation warnings in regexp patterns 2019-06-07 21:14:33 +00:00
.arcconfig
.clang-format
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
.gitattributes [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
.gitignore [clangd] Store index in '.clangd/index' instead of '.clangd-index' 2019-02-20 19:08:06 +00:00
CMakeLists.txt Build with _XOPEN_SOURCE defined on AIX 2019-06-07 15:45:25 +00:00
CODE_OWNERS.TXT [llvm-mca] Move llvm-mca library to llvm/lib/MCA. 2018-12-17 08:08:31 +00:00
configure
CREDITS.TXT [test commit] Add my name to the CREDITS.TXT 2019-05-27 07:48:28 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
llvm.spec.in Update structured references to the license to the new license. 2019-01-19 11:30:51 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
README.txt Testing commit access 2019-02-19 20:38:51 +00:00
RELEASE_TESTERS.TXT Update the list of platforms & archs 2018-12-16 14:47:16 +00:00

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.