summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2016-11-11 18:49:09 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2016-11-11 18:49:09 +0000
commitf48ffab554fa77306246eaac63970d53229b0c0d (patch)
tree6ba0f0313f89f1b277f04e6a72209dcd5d8fd51a /llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
parent6285f5b441bf602319c2bc3b4ed04a1450aa8247 (diff)
downloadbcm5719-llvm-f48ffab554fa77306246eaac63970d53229b0c0d.tar.gz
bcm5719-llvm-f48ffab554fa77306246eaac63970d53229b0c0d.zip
[cfi] Implement cfi-icall using inline assembly.
The current implementation is emitting a global constant that happens to evaluate to the same bytes + relocation as a jump instruction on X86. This does not work for PIE executables and shared libraries though, because we end up with a wrong relocation type. And it has no chance of working on ARM/AArch64 which use different relocation types for jump instructions (R_ARM_JUMP24) that is never generated for data. This change replaces the constant with module-level inline assembly followed by a hidden declaration of the jump table. Works fine for ARM/AArch64, but has some drawbacks. * Extra symbols are added to the static symbol table, which inflate the size of the unstripped binary a little. Stripped binaries are not affected. This happens because jump table declarations must be external (because their body is in the inline asm). * Original functions that were anonymous are now named <original name>.cfi, and it affects symbolization sometimes. This is necessary because the only user of these functions is the (inline asm) jump table, so they had to be added to @llvm.used, which does not allow unnamed functions. llvm-svn: 286611
Diffstat (limited to 'llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud