Go to file
Nick Desaulniers 6cff0cb35a lld: elf: discard more specific .gnu.linkonce section
Summary:
lld discards .gnu.linonce.* sections work around a bug in glibc.
https://sourceware.org/bugzilla/show_bug.cgi?id=20543

Unfortunately, the Linux kernel uses a section named
.gnu.linkonce.this_module to store infomation about kernel modules. The
kernel reads data from this section when loading kernel modules, and
errors if it fails to find this section. The current behavior of lld
discards this section when kernel modules are linked, so kernel modules
linked with lld are unloadable by the linux kernel.

The Linux kernel should use a comdat section instead of .gnu.linkonce.
The minimum version of binutils supported by the kernel supports comdat
sections. The kernel is also not relying on the old linkonce behavior;
it seems to have chosen a name that contains a deprecated GNU feature.

Changing the section name now in the kernel would require all kernel
modules to be recompiled to make use of the new section name. Instead,
rather than discarding .gnu.linkonce.*, let's discard the more specific
section name to continue working around the glibc issue while supporting
linking Linux kernel modules.

Link: https://github.com/ClangBuiltLinux/linux/issues/329

Reviewers: pcc, espindola

Reviewed By: pcc

Subscribers: nathanchance, emaste, arichardson, void, srhines

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

llvm-svn: 352302
2019-01-27 02:54:23 +00:00
clang [FIX] Adjust CXX microsoft abi dynamic cast test to r352293 2019-01-27 00:22:10 +00:00
clang-tools-extra Fix a lit test failure after D54438 2019-01-26 21:22:58 +00:00
compiler-rt [libFuzzer] add CompressedTest.cpp, a real-life-ish test for a custom mutator 2019-01-26 02:38:56 +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 Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
libcxx Mark awk.pass.cpp as XFAIL for NetBSD 2019-01-24 20:26:02 +00:00
libcxxabi [libcxxabi] Support building hermetic static library 2019-01-24 03:18:29 +00:00
libunwind [libunwind] Use placement new to avoid dependency C++ library 2019-01-25 21:39:46 +00:00
lld lld: elf: discard more specific .gnu.linkonce section 2019-01-27 02:54:23 +00:00
lldb [lldb] Update shebang python2 -> python 2019-01-26 01:05:02 +00:00
llgo Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
llvm GlobalISel: Fix typo in assert messages 2019-01-27 00:53:54 +00:00
openmp NFC: fixed formatting to be consistent across the file 2019-01-21 16:11:43 +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 Fix/unify top comment in lib/Analysis/PolyhedralInfo.cpp 2019-01-22 12:18:38 +00:00
pstl Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
.arcconfig Add an .arcconfig for the top of the git monorepo. 2019-01-11 16:27:14 +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.