diff options
| author | Kristof Beyls <kristof.beyls@arm.com> | 2015-03-04 09:12:08 +0000 |
|---|---|---|
| committer | Kristof Beyls <kristof.beyls@arm.com> | 2015-03-04 09:12:08 +0000 |
| commit | aea8461820908d143de43e4230b7483cbae50c4e (patch) | |
| tree | dc7df07539672ba836bfd6baa59e2ccff6478e8c /lldb/source/Plugins/ObjectFile/ELF | |
| parent | 483a3000f543fa082bbb7e34140771a6e4c36231 (diff) | |
| download | bcm5719-llvm-aea8461820908d143de43e4230b7483cbae50c4e.tar.gz bcm5719-llvm-aea8461820908d143de43e4230b7483cbae50c4e.zip | |
Fix PR22408 - LLVM producing AArch64 TLS relocations that GNU linkers cannot handle yet.
As is described at http://llvm.org/bugs/show_bug.cgi?id=22408, the GNU linkers
ld.bfd and ld.gold currently only support a subset of the whole range of AArch64
ELF TLS relocations. Furthermore, they assume that some of the code sequences to
access thread-local variables are produced in a very specific sequence.
When the sequence is not as the linker expects, it can silently mis-relaxe/mis-optimize
the instructions.
Even if that wouldn't be the case, it's good to produce the exact sequence,
as that ensures that linkers can perform optimizing relaxations.
This patch:
* implements support for 16MiB TLS area size instead of 4GiB TLS area size. Ideally clang
would grow an -mtls-size option to allow support for both, but that's not part of this patch.
* by default doesn't produce local dynamic access patterns, as even modern ld.bfd and ld.gold
linkers do not support the associated relocations. An option (-aarch64-elf-ldtls-generation)
is added to enable generation of local dynamic code sequence, but is off by default.
* makes sure that the exact expected code sequence for local dynamic and general dynamic
accesses is produced, by making use of a new pseudo instruction. The patch also removes
two (AArch64ISD::TLSDESC_BLR, AArch64ISD::TLSDESC_CALL) pre-existing AArch64-specific pseudo
SDNode instructions that are superseded by the new one (TLSDESC_CALLSEQ).
llvm-svn: 231227
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF')
0 files changed, 0 insertions, 0 deletions

