diff options
author | Mitch Phillips <mitchphillips@outlook.com> | 2017-10-31 23:20:05 +0000 |
---|---|---|
committer | Mitch Phillips <mitchphillips@outlook.com> | 2017-10-31 23:20:05 +0000 |
commit | 7db6f7a344653a7425ab1d6263f3c9a8356556a4 (patch) | |
tree | c24cfd12feff449f82f64196375904a0eb4a1c4c /llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp | |
parent | 7438b2631720c9e7cbd23d9ce789cafd02400cd5 (diff) | |
download | bcm5719-llvm-7db6f7a344653a7425ab1d6263f3c9a8356556a4.tar.gz bcm5719-llvm-7db6f7a344653a7425ab1d6263f3c9a8356556a4.zip |
Parse DWARF information to reduce false positives.
Summary: Help differentiate code and data by parsing DWARF information. This will reduce false positive rates where data is placed in executable sections and is mistakenly parsed as code, resulting in an inflation in the number of indirect CF instructions (and hence an inflation of the number of unprotected).
Also prints the DWARF line data around the region of each indirect CF instruction.
Reviewers: pcc
Subscribers: probinson, llvm-commits, vlad.tsyrklevich, mgorny, aprantl, kcc
Differential Revision: https://reviews.llvm.org/D38654
llvm-svn: 317050
Diffstat (limited to 'llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp')
-rw-r--r-- | llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp b/llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp index 1121045780f..808b9927fcc 100644 --- a/llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp +++ b/llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp @@ -221,6 +221,13 @@ void GraphBuilder::buildFlowGraphImpl(const FileAnalysis &Analysis, continue; } + // Call instructions are not valid in the upwards traversal. + if (ParentDesc.isCall()) { + Result.IntermediateNodes[ParentMeta.VMAddress] = Address; + Result.OrphanedNodes.push_back(ParentMeta.VMAddress); + continue; + } + // Evaluate the branch target to ascertain whether this XRef is the result // of a fallthrough or the target of a branch. uint64_t BranchTarget; |