mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-17 20:28:08 +00:00
fix llvm and afl-showmap
This commit is contained in:
@ -29,6 +29,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
|
|||||||
- added neverzero counting to trace-pc/pcgard
|
- added neverzero counting to trace-pc/pcgard
|
||||||
- fixes for laf-intel float splitting (thanks to mark-griffin for
|
- fixes for laf-intel float splitting (thanks to mark-griffin for
|
||||||
reporting)
|
reporting)
|
||||||
|
- fixes for llvm 4.0
|
||||||
- skipping ctors and ifuncs for instrumentation
|
- skipping ctors and ifuncs for instrumentation
|
||||||
- LTO: switch default to the dynamic memory map, set AFL_LLVM_MAP_ADDR
|
- LTO: switch default to the dynamic memory map, set AFL_LLVM_MAP_ADDR
|
||||||
for a fixed map address (eg. 0x10000)
|
for a fixed map address (eg. 0x10000)
|
||||||
|
@ -94,7 +94,7 @@ struct InsTrim : public ModulePass {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR >= 4 || \
|
#if LLVM_VERSION_MAJOR > 4 || \
|
||||||
(LLVM_VERSION_MAJOR == 4 && LLVM_VERSION_PATCH >= 1)
|
(LLVM_VERSION_MAJOR == 4 && LLVM_VERSION_PATCH >= 1)
|
||||||
#define AFL_HAVE_VECTOR_INTRINSICS 1
|
#define AFL_HAVE_VECTOR_INTRINSICS 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -371,8 +371,12 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
|
|
||||||
if (instrument_mode == INSTRUMENT_PCGUARD) {
|
if (instrument_mode == INSTRUMENT_PCGUARD) {
|
||||||
|
|
||||||
|
#if LLVM_VERSION_MAJOR >= 4
|
||||||
cc_params[cc_par_cnt++] =
|
cc_params[cc_par_cnt++] =
|
||||||
"-fsanitize-coverage=trace-pc-guard"; // edge coverage by default
|
"-fsanitize-coverage=trace-pc-guard"; // edge coverage by default
|
||||||
|
#else
|
||||||
|
FATAL("pcguard instrumentation requires llvm 4.0.1+");
|
||||||
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -260,6 +260,8 @@ void scanForDangerousFunctions(llvm::Module *M) {
|
|||||||
|
|
||||||
if (!M) return;
|
if (!M) return;
|
||||||
|
|
||||||
|
#if LLVM_VERSION_MAJOR >= 4
|
||||||
|
|
||||||
for (GlobalIFunc &IF : M->ifuncs()) {
|
for (GlobalIFunc &IF : M->ifuncs()) {
|
||||||
|
|
||||||
StringRef ifunc_name = IF.getName();
|
StringRef ifunc_name = IF.getName();
|
||||||
@ -325,6 +327,8 @@ void scanForDangerousFunctions(llvm::Module *M) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string getSourceName(llvm::Function *F) {
|
static std::string getSourceName(llvm::Function *F) {
|
||||||
|
@ -112,7 +112,7 @@ uint64_t PowerOf2Ceil(unsigned in) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* #if LLVM_VERSION_STRING >= "4.0.1" */
|
/* #if LLVM_VERSION_STRING >= "4.0.1" */
|
||||||
#if LLVM_VERSION_MAJOR >= 4 || \
|
#if LLVM_VERSION_MAJOR > 4 || \
|
||||||
(LLVM_VERSION_MAJOR == 4 && LLVM_VERSION_PATCH >= 1)
|
(LLVM_VERSION_MAJOR == 4 && LLVM_VERSION_PATCH >= 1)
|
||||||
#define AFL_HAVE_VECTOR_INTRINSICS 1
|
#define AFL_HAVE_VECTOR_INTRINSICS 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -963,7 +963,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
|||||||
|
|
||||||
// if a queue subdirectory exists switch to that
|
// if a queue subdirectory exists switch to that
|
||||||
u8 *dn = alloc_printf("%s/queue", in_dir);
|
u8 *dn = alloc_printf("%s/queue", in_dir);
|
||||||
if ((dir_in = opendir(in_dir))) {
|
if ((dir_in = opendir(dn)) != NULL) {
|
||||||
|
|
||||||
closedir(dir_in);
|
closedir(dir_in);
|
||||||
in_dir = dn;
|
in_dir = dn;
|
||||||
|
Reference in New Issue
Block a user