This initial commit does not add any specific binary analyses yet, it merely contains the boilerplate to introduce a new BOLT-based tool. This basically combines the 4 first patches from the prototype pac-ret and stack-clash binary analyzer discussed in RFC https://discourse.llvm.org/t/rfc-bolt-based-binary-analysis-tool-to-verify-correctness-of-security-hardening/78148 and published at https://github.com/llvm/llvm-project/compare/main...kbeyls:llvm-project:bolt-gadget-scanner-prototype The introduction of such a BOLT-based binary analysis tool was proposed and discussed in at least the following places: - The RFC pointed to above - EuroLLVM 2024 round table https://discourse.llvm.org/t/summary-of-bolt-as-a-binary-analysis-tool-round-table-at-eurollvm/78441 The round table showed quite a few people interested in being able to build a custom binary analysis quickly with a tool like this. - Also at the US LLVM dev meeting a few weeks ago, I heard interest from a few people, asking when the tool would be available upstream. - The presentation "Adding Pointer Authentication ABI support for your ELF platform" (https://llvm.swoogo.com/2024devmtg/session/2512720/adding-pointer-authentication-abi-support-for-your-elf-platform) explicitly mentioned interest to extend the prototype tool to verify correct implementation of pauthabi.
20 lines
325 B
CMake
20 lines
325 B
CMake
set(LLVM_LINK_COMPONENTS
|
|
${LLVM_TARGETS_TO_BUILD}
|
|
MC
|
|
Object
|
|
Support
|
|
)
|
|
|
|
add_bolt_tool(llvm-bolt-binary-analysis
|
|
binary-analysis.cpp
|
|
DISABLE_LLVM_LINK_LLVM_DYLIB
|
|
)
|
|
|
|
target_link_libraries(llvm-bolt-binary-analysis
|
|
PRIVATE
|
|
LLVMBOLTRewrite
|
|
LLVMBOLTUtils
|
|
)
|
|
|
|
add_dependencies(bolt llvm-bolt-binary-analysis)
|