mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-22 06:18:04 +00:00
Dynamic instrumentation filtering for LLVM native (#1971)
* Add two dynamic instrumentation filter methods to runtime * Always use pc-table with native pcguard * Add make_symbol_list.py and README
This commit is contained in:
committed by
GitHub
parent
2f9eeef60c
commit
58b80b68bc
26
src/afl-cc.c
26
src/afl-cc.c
@ -1920,35 +1920,27 @@ void add_native_pcguard(aflcc_state_t *aflcc) {
|
||||
/* If llvm-config doesn't figure out LLVM_MAJOR, just
|
||||
go on anyway and let compiler complain if doesn't work. */
|
||||
|
||||
if (aflcc->instrument_opt_mode & INSTRUMENT_OPT_CODECOV) {
|
||||
|
||||
#if LLVM_MAJOR > 0 && LLVM_MAJOR < 6
|
||||
FATAL("pcguard instrumentation with pc-table requires LLVM 6.0.1+");
|
||||
FATAL("pcguard instrumentation with pc-table requires LLVM 6.0.1+");
|
||||
#else
|
||||
#if LLVM_MAJOR == 0
|
||||
WARNF(
|
||||
"pcguard instrumentation with pc-table requires LLVM 6.0.1+"
|
||||
" otherwise the compiler will fail");
|
||||
WARNF(
|
||||
"pcguard instrumentation with pc-table requires LLVM 6.0.1+"
|
||||
" otherwise the compiler will fail");
|
||||
#endif
|
||||
if (aflcc->instrument_opt_mode & INSTRUMENT_OPT_CODECOV) {
|
||||
|
||||
insert_param(aflcc,
|
||||
"-fsanitize-coverage=trace-pc-guard,bb,no-prune,pc-table");
|
||||
#endif
|
||||
|
||||
} else {
|
||||
|
||||
#if LLVM_MAJOR > 0 && LLVM_MAJOR < 4
|
||||
FATAL("pcguard instrumentation requires LLVM 4.0.1+");
|
||||
#else
|
||||
#if LLVM_MAJOR == 0
|
||||
WARNF(
|
||||
"pcguard instrumentation requires LLVM 4.0.1+"
|
||||
" otherwise the compiler will fail");
|
||||
#endif
|
||||
insert_param(aflcc, "-fsanitize-coverage=trace-pc-guard");
|
||||
#endif
|
||||
insert_param(aflcc, "-fsanitize-coverage=trace-pc-guard,pc-table");
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void add_optimized_pcguard(aflcc_state_t *aflcc) {
|
||||
|
Reference in New Issue
Block a user