xref: /aosp_15_r20/external/AFLplusplus/instrumentation/afl-llvm-rt-lto.o.c (revision 08b48e0b10e97b33e7b60c5b6e2243bd915777f2)
1*08b48e0bSAndroid Build Coastguard Worker /*
2*08b48e0bSAndroid Build Coastguard Worker    american fuzzy lop++ - LLVM instrumentation bootstrap
3*08b48e0bSAndroid Build Coastguard Worker    -----------------------------------------------------
4*08b48e0bSAndroid Build Coastguard Worker 
5*08b48e0bSAndroid Build Coastguard Worker    Licensed under the Apache License, Version 2.0 (the "License");
6*08b48e0bSAndroid Build Coastguard Worker    you may not use this file except in compliance with the License.
7*08b48e0bSAndroid Build Coastguard Worker    You may obtain a copy of the License at:
8*08b48e0bSAndroid Build Coastguard Worker 
9*08b48e0bSAndroid Build Coastguard Worker      https://www.apache.org/licenses/LICENSE-2.0
10*08b48e0bSAndroid Build Coastguard Worker 
11*08b48e0bSAndroid Build Coastguard Worker */
12*08b48e0bSAndroid Build Coastguard Worker 
13*08b48e0bSAndroid Build Coastguard Worker #include <stdio.h>
14*08b48e0bSAndroid Build Coastguard Worker #include <stdlib.h>
15*08b48e0bSAndroid Build Coastguard Worker 
16*08b48e0bSAndroid Build Coastguard Worker // to prevent the function from being removed
17*08b48e0bSAndroid Build Coastguard Worker unsigned char __afl_lto_mode = 0;
18*08b48e0bSAndroid Build Coastguard Worker 
19*08b48e0bSAndroid Build Coastguard Worker /* Proper initialization routine. */
20*08b48e0bSAndroid Build Coastguard Worker 
__afl_auto_init_globals(void)21*08b48e0bSAndroid Build Coastguard Worker __attribute__((constructor(0))) void __afl_auto_init_globals(void) {
22*08b48e0bSAndroid Build Coastguard Worker 
23*08b48e0bSAndroid Build Coastguard Worker   if (getenv("AFL_DEBUG")) fprintf(stderr, "[__afl_auto_init_globals]\n");
24*08b48e0bSAndroid Build Coastguard Worker   __afl_lto_mode = 1;
25*08b48e0bSAndroid Build Coastguard Worker 
26*08b48e0bSAndroid Build Coastguard Worker }
27*08b48e0bSAndroid Build Coastguard Worker 
28