1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/tools
Joel Galenson 0dd9c1fcd6 [cfi-verify] Support cross-DSO
When used in cross-DSO mode, CFI will generate calls to special functions rather than trap instructions.  For example, instead of generating

if (!InlinedFastCheck(f))
  abort();
call *f

CFI generates

if (!InlinedFastCheck(f))
  __cfi_slowpath(CallSiteTypeId, f);
call *f

This patch teaches cfi-verify to recognize calls to __cfi_slowpath and abort and treat them as trap functions.

In addition to normal symbols, we also parse the dynamic relocations to handle cross-DSO calls in libraries.

We also extend cfi-verify to recognize other patterns that occur using cross-DSO.  For example, some indirect calls are not guarded by a branch to a trap but instead follow a call to __cfi_slowpath.  For example:

if (!InlinedFastCheck(f))
  call *f
else {
  __cfi_slowpath(CallSiteTypeId, f);
  call *f
}

In this case, the second call to f is not marked as protected by the current code.  We thus recognize if indirect calls directly follow a call to a function that will trap on CFI violations and treat them as protected.

We also ignore indirect calls in the PLT, since on AArch64 each entry contains an indirect call that should not be protected by CFI, and these are labeled incorrectly when debug information is not present.

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

llvm-svn: 340612
2018-08-24 15:21:58 +00:00
..
bugpoint
bugpoint-passes
dsymutil [DWARF] Unify warning callbacks. NFC. 2018-08-23 12:43:33 +00:00
gold [gold] -thinlto-object-suffix-replace: don't append new suffix if path does not end with old suffix 2018-08-22 02:11:36 +00:00
llc [llc] Fix sanitizer failure. 2018-06-23 19:04:10 +00:00
lli [ORC] Rename VSO to JITDylib. 2018-08-17 21:18:18 +00:00
llvm-ar [Support] NFC: Allow modifying access/modification times independently in sys::fs::setLastModificationAndAccessTime. 2018-08-13 23:03:45 +00:00
llvm-as [ThinLTO] Parse module summary index from assembly 2018-06-26 13:56:49 +00:00
llvm-as-fuzzer
llvm-bcanalyzer [ADT] Replace std::isprint by llvm::isPrint. 2018-07-26 15:31:41 +00:00
llvm-c-test [C-API][DIBuilder] Added DIFlags in LLVMDIBuilderCreateBasicType 2018-08-19 23:39:47 +00:00
llvm-cat
llvm-cfi-verify [cfi-verify] Support cross-DSO 2018-08-24 15:21:58 +00:00
llvm-config [llvm-config] Use WithColor for printing errors. 2018-06-23 16:50:09 +00:00
llvm-cov [Coverage] Delete getCounterMismatches, it's dead code (NFC) 2018-08-07 22:25:22 +00:00
llvm-cvtres
llvm-cxxdump Fixing a typo; NFC. 2018-07-23 18:09:43 +00:00
llvm-cxxfilt
llvm-demangle-fuzzer
llvm-diff
llvm-dis
llvm-dwarfdump [DebugInfo/DWARF] Remove redundant iterator type. NFC 2018-08-02 19:29:38 +00:00
llvm-dwp
llvm-exegesis [llvm-exegesis] Renaming classes and functions. 2018-08-03 09:29:38 +00:00
llvm-extract
llvm-go [bindings/go] Add coroutine passes 2018-08-19 23:40:05 +00:00
llvm-isel-fuzzer
llvm-jitlistener
llvm-link Restore "[ThinLTO] Ensure we always select the same function copy to import" 2018-07-16 15:30:27 +00:00
llvm-lto
llvm-lto2
llvm-mc [ADT] Normalize empty triple components 2018-08-08 22:23:57 +00:00
llvm-mc-assemble-fuzzer [llvm-mc-assemble-fuzzer] Update API - Pass MCObjectWriter instead of a stream 2018-08-17 04:38:41 +00:00
llvm-mc-disassemble-fuzzer
llvm-mca [llvm-mca] Fix parameter name. NFC. 2018-08-23 20:17:42 +00:00
llvm-modextract
llvm-mt [llvm-mt] Use WithColor for printing errors. 2018-06-23 16:49:07 +00:00
llvm-nm nm: Add -no-weak flag for hiding weak symbols 2018-07-02 17:24:37 +00:00
llvm-objcopy [llvm-objcopy] Simplify find(X,Y) != X.end() with is_contained() 2018-08-21 00:13:52 +00:00
llvm-objdump [llvm-objdump] Label calls to the PLT. 2018-08-24 15:21:57 +00:00
llvm-opt-fuzzer
llvm-opt-report
llvm-pdbutil [llvm-pdbutil] Support PDBs without a DBI stream 2018-08-06 19:35:00 +00:00
llvm-profdata Make llvm-profdata show -text work as advertised in the documentation. 2018-08-24 01:34:45 +00:00
llvm-rc
llvm-readobj MC: Teach the COFF object writer to write address-significance tables. 2018-08-22 23:58:16 +00:00
llvm-rtdyld
llvm-shlib [RFC] Build LLVM-C.dll on MSVC that exports only the C API 2018-08-07 15:54:50 +00:00
llvm-size [llvm-size] Make global variables static 2018-06-22 22:20:10 +00:00
llvm-special-case-list-fuzzer
llvm-split
llvm-stress
llvm-strings
llvm-symbolizer
llvm-undname [llvm-undname Add an option to dump back references. 2018-08-01 18:33:04 +00:00
llvm-xray [XRay][tools] Use Support/JSON.h in llvm-xray convert 2018-08-03 09:21:31 +00:00
llvm-yaml-numeric-parser-fuzzer Use LLVM_BUILTIN_TRAP not __builtin_trap to appease windows builds. NFCI. 2018-08-20 09:49:20 +00:00
lto
msbuild vs integration: bump version number 2018-08-09 11:57:36 +00:00
obj2yaml
opt [Debugify] Export per-pass debug info loss statistics 2018-07-24 00:41:29 +00:00
opt-viewer
sancov
sanstats
verify-uselistorder
xcode-toolchain [CMake] Use LLVM_ENABLE_IDE instead of CMAKE_CONFIGURATION_TYPES 2018-08-22 18:40:24 +00:00
yaml2obj [yaml2obj] - Allow to use numeric sh_link (Link) value for sections. 2018-08-16 12:44:17 +00:00
CMakeLists.txt [RFC] Build LLVM-C.dll on MSVC that exports only the C API 2018-08-07 15:54:50 +00:00
LLVMBuild.txt Add a Microsoft Demangler. 2018-07-20 17:27:48 +00:00