aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2019-07-22 18:50:45 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2019-07-22 18:50:45 +0000
commitef5cfc2dae0725226254561b42134308720e57ab (patch)
tree51643c26c4ce1ac61059ca60f431303f4464174c /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent324d33dd4ed653d54466a45ba0e397015c900a5b (diff)
downloadllvm-ef5cfc2dae0725226254561b42134308720e57ab.zip
llvm-ef5cfc2dae0725226254561b42134308720e57ab.tar.gz
llvm-ef5cfc2dae0725226254561b42134308720e57ab.tar.bz2
WholeProgramDevirt: Teach the pass to respect the global's alignment.
The bytes inserted before an overaligned global need to be padded according to the alignment set on the original global in order for the initializer to meet the global's alignment requirements. The previous implementation that padded to the pointer width happened to be correct for vtables on most platforms but may do the wrong thing if the vtable has a larger alignment. This issue is visible with a prototype implementation of HWASAN for globals, which will overalign all globals including vtables to 16 bytes. There is also no padding requirement for the bytes inserted after the global because they are never read from nor are they significant for alignment purposes, so stop inserting padding there. Differential Revision: https://reviews.llvm.org/D65031 llvm-svn: 366725
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
0 files changed, 0 insertions, 0 deletions