forked from OSchip/llvm-project
4dc2fb123d
In GNU ld, -Ttext sets the address of the .text section and -Ttext-segment sets the address of the text segment (RX). gold only supports the -Ttext-segment semantic and treats -Ttext as an alias for -Ttext-segment. lld only supports the -Ttext semantic and treats -Ttext-segment as an alias for -Ttext. The text segment will be assigned to an address less than the specified -Ttext-segment value. This patch drops the -Ttext-segment alias. The text segment is traditionally the first segment. Users who specify -Ttext-segment may actually want to specify --image-base, the lld way to express this. Unfortunately currently this is supported by GNU ld's COFF port but not by its ELF port. gold does not support this option. With -z separate-code, the behavior of GNU ld -Ttext-segment is weird (see https://sourceware.org/bugzilla/show_bug.cgi?id=25207) rL289827 introduced the alias for linking qemu's non-pie user mode binaries. As explained previously, this actually assigns the text segment to an address less than 0x60000000. I feel that a better fix is on the qemu side: https://lists.nongnu.org/archive/html/qemu-devel/2019-11/msg02480.html Reviewed By: grimar, ruiu Differential Revision: https://reviews.llvm.org/D70468 |
||
---|---|---|
.. | ||
COFF | ||
Common | ||
ELF | ||
MinGW | ||
cmake/modules | ||
docs | ||
include/lld | ||
lib | ||
test | ||
tools/lld | ||
unittests | ||
utils | ||
wasm | ||
.arcconfig | ||
.clang-format | ||
.gitignore | ||
CMakeLists.txt | ||
CODE_OWNERS.TXT | ||
LICENSE.TXT | ||
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.