llvm-project/lld
Fangrui Song 37a1291885 [ELF] Add RelocationScanner. NFC
Currently the way some relocation-related static functions pass around
states is clumsy. Add a Resolver class to store some states as member
variables.

Advantages:

* Avoid the parameter `InputSectionBase &sec` (this offsets the cost passing around `this` paramemter)
* Avoid the parameter `end` (Mips and PowerPC hacks)
* `config` and `target` can be cached as member variables to reduce global state accesses. (potential speedup because the compiler didn't know `config`/`target` were not changed across function calls)
* If we ever want to reduce if-else costs (e.g. `config->emachine==EM_MIPS` for non-Mips) or introduce parallel relocation scan not handling some tricky arches (PPC/Mips), we can templatize Resolver

`target` isn't used as much as `config`, so I change it to a const reference
during the migration.

There is a minor performance inprovement for elf::scanRelocations.

Reviewed By: ikudrin, peter.smith

Differential Revision: https://reviews.llvm.org/D116881
2022-01-11 09:54:53 -08:00
..
COFF Use true/false instead of 1/0 (NFC) 2022-01-09 12:21:06 -08:00
Common [lld] Add support for other demanglers other than Itanium 2022-01-05 03:25:41 +00:00
ELF [ELF] Add RelocationScanner. NFC 2022-01-11 09:54:53 -08:00
MachO [lld-macho] Change some global pointers to unique_ptr 2022-01-10 19:39:14 -08:00
MinGW [lld][MinGW] Remove `--no-as-needed` from ignored flags 2022-01-03 23:01:02 +01:00
cmake/modules [CMake] Factor out config prefix finding logic 2022-01-07 20:16:18 +00:00
docs [ELF] Update help messages to prefer canonical name for some long options 2022-01-06 00:43:46 -08:00
include/lld Revert "Revert D109159 "[amdgpu] Enable selection of `s_cselect_b64`."" 2022-01-05 13:10:25 -05:00
test [mips][lld] Add test case to check symbol index reading on mips64el. NFC 2022-01-11 19:08:20 +03:00
tools/lld [lld][CMake] Use `GNUInstallDirs` to support custom installation dirs 2021-12-31 18:57:57 +00:00
utils
wasm [lld] Add support for other demanglers other than Itanium 2022-01-05 03:25:41 +00:00
.clang-format
.clang-tidy NFC: .clang-tidy: Inherit configs from parents to improve maintainability 2021-06-08 08:25:59 -07:00
.gitignore
CMakeLists.txt [lld] Deprecate using llvm-config to detect llvm installation 2022-01-07 20:51:14 +00:00
CODE_OWNERS.TXT Add code owners of new MachO port 2020-09-02 19:32:12 -07:00
LICENSE.TXT
README.md [doc] Place sha256 in lld/README.md into backticks 2021-01-12 10:19:40 -08:00

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.