llvm-project/lld
Peter Smith 0ae7990b60 [ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections
Both the .ARM.exidx and .eh_frame sections have a custom SyntheticSection
that acts as a container for the InputSections. The InputSections are added
to the SyntheticSection prior to /DISCARD/ which limits the affect a
/DISCARD/ can have to the whole SyntheticSection. In the majority of cases
this is sufficient as it is not common to discard subsets of the
InputSections. The Linux kernel has one of these scripts which has something
like:
/DISCARD/ : { *(.ARM.exidx.exit.text) *(.ARM.extab.exit.text) ... }
The .ARM.exidx.exit.text are not discarded because the InputSection has been
transferred to the Synthetic Section. The *(.ARM.extab.exit.text) sections
have not so they are discarded. When we come to write out the .ARM.exidx
sections the dangling references from .ARM.exidx.exit.text to
.ARM.extab.exit.text currently cause relocation out of range errors, but
could as easily cause a fatal error message if we check for dangling
references at relocation time.

This patch attempts to respect the /DISCARD/ command by running it on the
.ARM.exidx InputSections stored in the SyntheticSection.

The .eh_frame is in theory affected by this problem, but I don't think that
there is a dangling reference problem that can happen with these sections.

Fixes remaining part of pr44824

Differential Revision: https://reviews.llvm.org/D79687
2020-05-11 14:27:13 +01:00
..
COFF [LLD] [COFF] Fix def file exporting of symbols containing periods 2020-05-10 23:30:14 +03:00
Common [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
ELF [ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections 2020-05-11 14:27:13 +01:00
MachO [lld-macho] Support pc-relative section relocations 2020-05-09 20:56:23 -07:00
MinGW Remove unused Endian.h includes, NFC 2020-03-11 15:45:34 -07:00
cmake/modules
docs [ELF] Add convenience TableGen classes to enforce two dashes for options not supported by GNU ld 2020-05-08 07:37:06 -07:00
include/lld [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
lib [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
test [ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections 2020-05-11 14:27:13 +01:00
tools/lld Reland D78837 [lld] Remove special cases from default ld driver mode. 2020-04-29 14:45:44 -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 [WebAssembly] Disallow 'shared-mem' rather than 'atomics' 2020-05-08 13:52:39 -07: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 Revert "Temporarily revert "build: use `find_package(Python3)` if available"" 2020-04-29 01:38:08 +00: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.