diff options
author | Peter Smith <peter.smith@linaro.org> | 2017-09-06 14:23:06 +0000 |
---|---|---|
committer | Peter Smith <peter.smith@linaro.org> | 2017-09-06 14:23:06 +0000 |
commit | 1d5a070386bab364ea34b0230707edfced7df5e9 (patch) | |
tree | ed15cfab17feab76816a662a0e9a25e3e757ac8a /clang/lib/CodeGen/CGOpenMPRuntime.cpp | |
parent | 3ef89b0fc7af7436f8f952e24cd50dfdfb87d08d (diff) | |
download | bcm5719-llvm-1d5a070386bab364ea34b0230707edfced7df5e9.tar.gz bcm5719-llvm-1d5a070386bab364ea34b0230707edfced7df5e9.zip |
[ELF][AArch64] Add alignment checks for the LDST<N>_ABS_LO12_NC relocations
The R_AARCH64_LDST<N>_ABS LO12_NC relocations where N is 8, 16, 32, 64 or
128 have a scaled immediate. For example R_AARCH64_LDST32_ABS_LO12_NC
shifts the calculated value right by 4. If the target symbol + relocation
addend is not aligned properly then bits of the answer will be lost.
This change adds an alignment check to the relocations to make sure the
target of the relocation is aligned properly. This matches the behavior of
GNU ld. The motivation is to catch ODR violations such as a declaration of
extern int foo, but a definition of bool foo as the compiler may use
R_AARCH64_LDST32_ABS_LO12_NC for the former, but not align the destination.
Differential Revision: https://reviews.llvm.org/D37444
llvm-svn: 312637
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
0 files changed, 0 insertions, 0 deletions