llvm-project/lld
Peter Smith 2539b4ae47 [LLD][ELF] Allow empty (.init|.preinit|.fini)_array to be RELRO
The default GNU linker script uses the following idiom for the array
sections. I'll use .init_array here, but this also applies to
.preinit_array and .fini_array sections.

  .init_array    :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(.init_array))
    PROVIDE_HIDDEN (__init_array_end = .);
  }

The C-library will take references to the _start and _end symbols to
process the array. This will make LLD keep the OutputSection even if there
are no .init_array sections. As the current check for RELRO uses the
section type for .init_array the above example with no .init_array
InputSections fails the checks as there are no .init_array sections to give
the OutputSection a type of SHT_INIT_ARRAY. This often leads to a
non-contiguous RELRO error message.

The simple fix is to a textual section match as well as a section type
match.

Differential Revision: https://reviews.llvm.org/D76915
2020-03-31 12:53:12 +01:00
..
COFF lld: Reduce number of references to undefined printed from 10 to 3. 2020-03-30 14:31:32 -04:00
Common Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc by runtime registration 2020-03-17 14:01:30 +01:00
ELF [LLD][ELF] Allow empty (.init|.preinit|.fini)_array to be RELRO 2020-03-31 12:53:12 +01:00
MinGW Remove unused Endian.h includes, NFC 2020-03-11 15:45:34 -07:00
cmake/modules
docs doc: use the right url to bugzilla 2020-03-22 22:49:40 +01:00
include/lld LLD already has a mechanism for caching creation of DWARCContext: 2020-03-06 21:17:07 +03:00
lib Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
test [LLD][ELF] Allow empty (.init|.preinit|.fini)_array to be RELRO 2020-03-31 12:53:12 +01:00
tools/lld [lld] Enabling loading LLVM pass plugins 2020-03-23 14:18:32 -07:00
unittests Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
utils Python 2/3 compatibility 2019-03-20 07:42:13 +00:00
wasm [ThinLTO] Allow usage of all hardware threads in the system 2020-03-27 10:20:58 -04:00
.clang-format
.clang-tidy [lld] Add .clang-tidy to customize readability-identifier-naming.{Member,Parameter,Variable}Case => camelBack 2020-03-09 08:26:41 -07:00
.gitignore
CMakeLists.txt try to unbreak build after 4b6d9ac392 2020-01-16 10:12:35 -05:00
CODE_OWNERS.TXT
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
README.md

README.md

LLVM Linker (lld)

This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.

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

Benchmarking

In order to make sure various developers can evaluate patches over the same tests, we create a collection of self contained programs.

It is hosted at https://s3-us-west-2.amazonaws.com/linker-tests/lld-speed-test.tar.xz

The current sha256 is 10eec685463d5a8bbf08d77f4ca96282161d396c65bd97dc99dbde644a31610f.