[AArch64] Cortex-a53-843419 erratum should not apply to relaxed TLS.
authorPeter Smith <peter.smith@linaro.org>
Tue, 27 Nov 2018 10:17:35 +0000 (10:17 +0000)
committerPeter Smith <peter.smith@linaro.org>
Tue, 27 Nov 2018 10:17:35 +0000 (10:17 +0000)
commit8a3e7178f6cc29f57e1f608d50b17a8960300391
treee28c6c312ff4b32a70fcf406ced335ba597678b3
parentb93baf65c04b4999ab435389c37b2d046f0503a4
[AArch64] Cortex-a53-843419 erratum should not apply to relaxed TLS.

The changes to the instructions performed by TLS relaxation and the errata
patching are performed with relocations. As these are applied so late the
errata scanning won't see the changes in the section data made by the TLS
relaxation. This can lead to a TLS relaxed sequence being patched when it
doesn't need to be.

The fix checks to see if there is a R_RELAX_TLS_IE_TO_LE instruction at the
same address as the ADRP as this indicates the presence of a relaxation
of a sequence that might get recognised as a patch.

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

llvm-svn: 347649
lld/ELF/AArch64ErrataFix.cpp
lld/test/ELF/aarch64-cortex-a53-843419-tlsrelax.s [new file with mode: 0644]