Go to file
Fangrui Song b4744d306c [ELF] Support --{,no-}allow-shlib-undefined
Summary:
In ld.bfd/gold, --no-allow-shlib-undefined is the default when linking
an executable. This patch implements a check to error on undefined
symbols in a shared object, if all of its DT_NEEDED entries are seen.

Our approach resembles the one used in gold, achieves a good balance to
be useful but not too smart (ld.bfd traces all DSOs and emulates the
behavior of a dynamic linker to catch more cases).

The error is issued based on the symbol table, different from undefined
reference errors issued for relocations. It is most effective when there
are DSOs that were not linked with -z defs (e.g. when static sanitizers
runtime is used).

gold has a comment that some system libraries on GNU/Linux may have
spurious undefined references and thus system libraries should be
excluded (https://sourceware.org/bugzilla/show_bug.cgi?id=6811). The
story may have changed now but we make --allow-shlib-undefined the
default for now. Its interaction with -shared can be discussed in the
future.

Reviewers: ruiu, grimar, pcc, espindola

Reviewed By: ruiu

Subscribers: joerg, emaste, arichardson, llvm-commits

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

llvm-svn: 352826
2019-02-01 02:25:05 +00:00
clang [analyzer] [RetainCountChecker] Fix object type for CF/Obj-C bridged casts 2019-02-01 02:13:02 +00:00
clang-tools-extra [clangd] A code action to swap branches of an if statement 2019-01-31 21:30:05 +00:00
compiler-rt Mark __rela_iplt_{start,end} as weak. 2019-02-01 00:43:31 +00:00
debuginfo-tests Set config.lit_tools_dir, which is needed by lit.llvm.initialize. 2018-11-06 21:54:27 +00:00
libclc Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
libcxx Fix a bit of libc++-specific behavior in the regex tests; add a missing test. Reviewed as https://reviews.llvm.org/D57391 Thanks to Andrey Maksimov for the patch 2019-01-31 18:54:26 +00:00
libcxxabi [CMake] Use correct visibility for linked libraries in CMake 2019-01-30 23:18:05 +00:00
libunwind [CMake] Use correct visibility for linked libraries in CMake 2019-01-30 23:18:05 +00:00
lld [ELF] Support --{,no-}allow-shlib-undefined 2019-02-01 02:25:05 +00:00
lldb [unittest] Fix scalar unit test. 2019-01-31 18:48:17 +00:00
llgo Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
llvm [x86] adjust test to show both add/inc options; NFC 2019-02-01 00:07:20 +00:00
openmp [OMPT] Make sure that OMPT is enabled when accessing internals of the runtime 2019-01-30 08:41:06 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
pstl Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
README.md

README.md

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.