Go to file
Ali Tamur 63830b2794 Introduce a flag to warn when ifunc symbols are used with text relocations.
Summary:
This patch adds a new flag, --warn-ifunc-textrel, to work around a glibc bug. When a code with ifunc symbols is used to produce an object file with text relocations, lld always succeeds. However, if that object file is linked using an old version of glibc, the resultant binary just crashes with segmentation fault when it is run (The bug is going to be corrected as of glibc 2.19).

Since there is no way to tell beforehand what library the object file will be linked against in the future, there does not seem to be a fool-proof way for lld to give an error only in cases where the binary will crash. So, with this change (dated 2018-09-25), lld starts to give a warning, contingent on a new command line flag that does not have a gnu counter part. The default value for --warn-ifunc-textrel is false, so lld behaviour will not change unless the user explicitly asks lld to give a warning. Users that link with a glibc library with version 2.19 or newer, or does not use ifunc symbols, or does not generate object files with text relocations do not need to take any action. Other users may consider to start passing warn-ifunc-textrel to lld to get early warnings.

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: grimar, MaskRay, markj, emaste, arichardson, llvm-commits

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

llvm-svn: 343628
2018-10-02 20:30:22 +00:00
clang [analyzer][NFC] Refactor functions in PlistDiagnostics to take AnalyzerOptions as parameter 2018-10-02 19:27:34 +00:00
clang-tools-extra [clangd] Try to fix windows buildbot after r343576 2018-10-02 20:00:32 +00:00
compiler-rt [lib/fuzzer] Fix logging for Fuchsia 2018-10-02 17:21:04 +00:00
debuginfo-tests Revert "(Retry) Add a basic integration test for C++ smart pointers" 2018-08-20 19:53:33 +00:00
libclc configure: Rework support for gfx9+ devices that were added post LLVM 3.9 2018-09-15 22:02:01 +00:00
libcxx Remove redundant null pointer check in operator delete 2018-10-01 17:21:07 +00:00
libcxxabi Update docs to reference new libc++ mailing lists. 2018-09-22 19:52:12 +00:00
libunwind Reverting r342895 2018-09-24 16:36:33 +00:00
lld Introduce a flag to warn when ifunc symbols are used with text relocations. 2018-10-02 20:30:22 +00:00
lldb Remove unnecessary field 2018-10-02 20:14:12 +00:00
llgo Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm [CodeView] Only add the Scoped flag for an enum type when it has an immediate function scope to match MSVC 2018-10-02 20:28:15 +00:00
openmp [OpenMP] Shutdown library on Windows if possible for better OMPT behavior 2018-10-02 19:15:04 +00:00
parallel-libs Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
polly [IslAst] Fix InParallelFor nesting. 2018-09-27 13:39:37 +00:00
README.md

README.md

Low Level Virtual Machine (LLVM)

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