hanchenye-llvm-project/lld
Fangrui Song 912251e82f [PPC64] toc-indirect to toc-relative relaxation
This is based on D54720 by Sean Fertile.

When accessing a global symbol which is not defined in the translation unit,
compilers will generate instructions that load the address from the toc entry.

If the symbol is defined, non-preemptable, and addressable with a 32-bit
signed offset from the toc pointer, the address can be computed
directly. e.g.

    addis 3, 2, .LC0@toc@ha  # R_PPC64_TOC16_HA
    ld    3, .LC0@toc@l(3)   # R_PPC64_TOC16_LO_DS, load the address from a .toc entry
    ld/lwa 3, 0(3)           # load the value from the address

    .section .toc,"aw",@progbits
    .LC0: .tc var[TC],var

can be relaxed to

    addis 3,2,var@toc@ha     # this may be relaxed to a nop,
    addi  3,3,var@toc@l      # then this becomes addi 3,2,var@toc
    ld/lwa 3, 0(3)           # load the value from the address

We can delete the test ppc64-got-indirect.s as its purpose is covered by
newly added ppc64-toc-relax.s and ppc64-toc-relax-constants.s

Reviewed By: ruiu, sfertile

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

llvm-svn: 360112
2019-05-07 04:26:05 +00:00
..
COFF Shrink SectionChunk by combining Relocs and SectionName sizes 2019-05-03 20:17:14 +00:00
Common Fail early if an output file is not writable 2019-03-11 16:30:55 +00:00
ELF [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
MinGW [MinGW] Add an --appcontainer flag, passed through to lld-link 2019-04-19 13:50:43 +00:00
cmake/modules
docs lld-link: Add /force:multipleres extension to make dupe resource diag non-fatal 2019-05-02 21:21:55 +00:00
include/lld Fail early if an output file is not writable 2019-03-11 16:30:55 +00:00
lib Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
test [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
tools/lld Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
unittests Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
utils Python 2/3 compatibility 2019-03-20 07:42:13 +00:00
wasm [WebAssembly] Always take into account added when applying runtime relocations 2019-04-25 17:11:54 +00:00
.arcconfig
.clang-format
.gitignore
CMakeLists.txt
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.