diff options
author | Fangrui Song <i@maskray.me> | 2019-11-19 14:16:04 -0800 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-11-21 09:41:55 -0800 |
commit | 4dc2fb123dcfe9a97ad6f3a1135053b74efd0bc9 (patch) | |
tree | 9c0447f8e530bb4e4b6586f5b1ccf2c8cfedc453 /lldb/packages/Python/lldbsuite/test/python_api/thread/main2.cpp | |
parent | 30ccee71ca0218248c39768102488ef589ea9c1b (diff) | |
download | bcm5719-llvm-4dc2fb123dcfe9a97ad6f3a1135053b74efd0bc9.tar.gz bcm5719-llvm-4dc2fb123dcfe9a97ad6f3a1135053b74efd0bc9.zip |
[ELF] Error if -Ttext-segment is specified
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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/thread/main2.cpp')
0 files changed, 0 insertions, 0 deletions