fix llvm and afl-showmap

This commit is contained in:
van Hauser
2020-08-13 22:34:11 +02:00
parent e9fb5f4cbc
commit b5d1a021ef
6 changed files with 12 additions and 3 deletions

View File

@ -29,6 +29,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
- added neverzero counting to trace-pc/pcgard
- fixes for laf-intel float splitting (thanks to mark-griffin for
reporting)
- fixes for llvm 4.0
- skipping ctors and ifuncs for instrumentation
- LTO: switch default to the dynamic memory map, set AFL_LLVM_MAP_ADDR
for a fixed map address (eg. 0x10000)

View File

@ -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)
#define AFL_HAVE_VECTOR_INTRINSICS 1
#endif

View File

@ -371,8 +371,12 @@ static void edit_params(u32 argc, char **argv, char **envp) {
if (instrument_mode == INSTRUMENT_PCGUARD) {
#if LLVM_VERSION_MAJOR >= 4
cc_params[cc_par_cnt++] =
"-fsanitize-coverage=trace-pc-guard"; // edge coverage by default
#else
FATAL("pcguard instrumentation requires llvm 4.0.1+");
#endif
} else {

View File

@ -260,6 +260,8 @@ void scanForDangerousFunctions(llvm::Module *M) {
if (!M) return;
#if LLVM_VERSION_MAJOR >= 4
for (GlobalIFunc &IF : M->ifuncs()) {
StringRef ifunc_name = IF.getName();
@ -325,6 +327,8 @@ void scanForDangerousFunctions(llvm::Module *M) {
}
#endif
}
static std::string getSourceName(llvm::Function *F) {

View File

@ -112,7 +112,7 @@ uint64_t PowerOf2Ceil(unsigned in) {
#endif
/* #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)
#define AFL_HAVE_VECTOR_INTRINSICS 1
#endif

View File

@ -963,7 +963,7 @@ int main(int argc, char **argv_orig, char **envp) {
// if a queue subdirectory exists switch to that
u8 *dn = alloc_printf("%s/queue", in_dir);
if ((dir_in = opendir(in_dir))) {
if ((dir_in = opendir(dn)) != NULL) {
closedir(dir_in);
in_dir = dn;