mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 20:08:07 +00:00
break up llvm rt afl init
This commit is contained in:
@ -35,6 +35,8 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
@ -848,7 +850,6 @@ void __afl_manual_init(void) {
|
||||
|
||||
if (!init_done) {
|
||||
|
||||
__afl_map_shm();
|
||||
__afl_start_forkserver();
|
||||
init_done = 1;
|
||||
|
||||
@ -856,17 +857,27 @@ void __afl_manual_init(void) {
|
||||
|
||||
}
|
||||
|
||||
/* Proper initialization routine. */
|
||||
/* Initialization of the forkserver - latest possible */
|
||||
|
||||
__attribute__((constructor(CONST_PRIO))) void __afl_auto_init(void) {
|
||||
__attribute__((constructor())) void __afl_auto_init(void) {
|
||||
|
||||
if (getenv("AFL_DISABLE_LLVM_INSTRUMENTATION")) return;
|
||||
|
||||
if (getenv(DEFER_ENV_VAR)) return;
|
||||
|
||||
__afl_manual_init();
|
||||
|
||||
}
|
||||
|
||||
/* Initialization of the shmem - earliest possible because of LTO fixed mem. */
|
||||
|
||||
__attribute__((constructor(0))) void __afl_auto_early(void) {
|
||||
|
||||
if (getenv("AFL_DISABLE_LLVM_INSTRUMENTATION")) return;
|
||||
|
||||
is_persistent = !!getenv(PERSIST_ENV_VAR);
|
||||
|
||||
if (getenv(DEFER_ENV_VAR)) return;
|
||||
|
||||
__afl_manual_init();
|
||||
__afl_map_shm();
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user