[ELF] Complete implementation of --fix-cortex-a53-843419
authorPeter Smith <peter.smith@linaro.org>
Fri, 15 Dec 2017 10:32:34 +0000 (10:32 +0000)
committerPeter Smith <peter.smith@linaro.org>
Fri, 15 Dec 2017 10:32:34 +0000 (10:32 +0000)
commitcf354873c106b4ef1cd7934bd7335f71c65995a6
tree3fb132540d273f0fc3815c73bb7fd7ed85d26961
parent0ad4c265d7202724a07c0473b5212d02b687c2d6
[ELF] Complete implementation of --fix-cortex-a53-843419

This patch provides the mechanism to fix instances of the instruction
sequence that may trigger the cortex-a53 843419 erratum. The fix is
provided by an alternative instruction sequence to remove one of the
erratum conditions. To reach this alternative instruction sequence we
replace the original instruction with a branch to the alternative
sequence. The alternative sequence is responsible for branching back to
the original.

As there is only erratum to fix the implementation is specific to
AArch64 and the specific erratum conditions. It should be generalizable
to other targets and erratum if needed.

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

llvm-svn: 320800
lld/ELF/AArch64ErrataFix.cpp
lld/ELF/AArch64ErrataFix.h
lld/ELF/Writer.cpp
lld/test/ELF/aarch64-cortex-a53-843419-address.s
lld/test/ELF/aarch64-cortex-a53-843419-recognize.s
lld/test/ELF/aarch64-cortex-a53-843419-thunk.s