Go to file
Peter Collingbourne 1b6fd1f5fd COFF: Symbol resolution for common and comdat symbols defined in bitcode.
In the case where either a bitcode file and a regular file or two bitcode
files export a common or comdat symbol with the same name, the linker needs
to pick one of them following COFF semantics. This patch implements a design
for resolving such symbols that pushes most of the work onto either LLD's
regular mechanism for resolving common or comdat symbols or the IR linker's
mechanism for doing the same.

We modify SymbolBody::compare to always prefer non-bitcode symbols, so that
during the initial phase of symbol resolution, the symbol table always contains
a regular symbol in any case where we need to choose between a regular and
a bitcode symbol. In SymbolTable::addCombinedLTOObject, we force export
any bitcode symbols that were initially pre-empted by a regular symbol,
and later use SymbolBody::compare to choose between the regular symbol in
the symbol table and the regular symbol from the combined LTO object file.

This design seems to be sound, so long as the resolution mechanism is defined
to be commutative and associative modulo arbitrary choices between symbols
(which seems to be the case for COFF).

Differential Revision: http://reviews.llvm.org/D10329

llvm-svn: 239563
2015-06-11 21:49:54 +00:00
clang [ms] Do lookup in dependent base classes also when overload resolution fails (PR23810) 2015-06-11 21:21:57 +00:00
clang-tools-extra Fixed modularize to warn about missing headers referenced in a module map. 2015-06-04 23:35:19 +00:00
compiler-rt [CMake] Cleanup add_compiler_rt_object_library to be platform-agnostic 2015-06-10 23:55:07 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Use a more accurate implementation for exp 2015-05-13 03:55:09 +00:00
libcxx Change #ifdefs in test to UNSUPPORTED. No functionality change in the tests 2015-06-11 21:47:39 +00:00
libcxxabi fallback_malloc: silence conversion warning (NFC) 2015-06-03 17:25:35 +00:00
libunwind Code cleanup: Reindent statements. 2015-05-30 14:00:39 +00:00
lld COFF: Symbol resolution for common and comdat symbols defined in bitcode. 2015-06-11 21:49:54 +00:00
lldb [LLDB][MIPS] Getting correct signals for MIPS Host 2015-06-10 10:02:21 +00:00
llgo [llgo] cmd/llgoi: use line editor 2015-05-23 15:16:09 +00:00
llvm [Orc] Make partition identification in the CompileOnDemand layer lazy. 2015-06-11 21:45:19 +00:00
openmp Remove unused variables '__kmp_build_check_*' for non assert builds. 2015-06-11 17:36:16 +00:00
polly Revert "Add NVIDIA vprintf printing to RuntimeDebugBuilder" 2015-06-08 16:24:49 +00:00