mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-10 01:01:33 +00:00
afl untracer haiku build fix.
This commit is contained in:
parent
1604351368
commit
2c40fc4ae8
@ -3,11 +3,16 @@ ifdef DEBUG
|
||||
else
|
||||
OPT=-O3
|
||||
endif
|
||||
SYS = $(shell uname -s)
|
||||
DL =
|
||||
ifeq "$(SYS)" "Linux"
|
||||
DL = -ldl
|
||||
endif
|
||||
|
||||
all: afl-untracer libtestinstr.so
|
||||
|
||||
afl-untracer: afl-untracer.c
|
||||
$(CC) $(OPT) -I../../include -g -o afl-untracer afl-untracer.c -ldl
|
||||
$(CC) $(OPT) -I../../include -g -o afl-untracer afl-untracer.c $(DL)
|
||||
|
||||
libtestinstr.so: libtestinstr.c
|
||||
$(CC) -g -O0 -fPIC -o libtestinstr.so -shared libtestinstr.c
|
||||
|
@ -53,7 +53,9 @@
|
||||
#include <pthread.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
#if !defined(__HAIKU__)
|
||||
#include <sys/shm.h>
|
||||
#endif
|
||||
#include <sys/wait.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@ -66,6 +68,9 @@
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/procctl.h>
|
||||
#elif defined(__HAIKU__)
|
||||
#include <kernel/OS.h>
|
||||
#include <kernel/image.h>
|
||||
#else
|
||||
#error "Unsupported platform"
|
||||
#endif
|
||||
@ -231,7 +236,28 @@ void read_library_information(void) {
|
||||
start += size;
|
||||
|
||||
}
|
||||
#elif defined(__HAIKU__)
|
||||
image_info ii;
|
||||
int32 c = 0;
|
||||
|
||||
while (get_next_image_info(0, &c, &ii) == B_OK) {
|
||||
|
||||
liblist[liblist_cnt].name = (u8 *)strdup(ii.name);
|
||||
liblist[liblist_cnt].addr_start = (u64)ii.text;
|
||||
liblist[liblist_cnt].addr_end = (u64)((char *)ii.text + ii.text_size);
|
||||
|
||||
if (debug) {
|
||||
|
||||
fprintf(stderr, "%s:%lx (%lx-%lx)\n", liblist[liblist_cnt].name,
|
||||
(unsigned long)(liblist[liblist_cnt].addr_end -
|
||||
liblist[liblist_cnt].addr_start),
|
||||
(unsigned long)liblist[liblist_cnt].addr_start,
|
||||
(unsigned long)(liblist[liblist_cnt].addr_end - 1));
|
||||
|
||||
}
|
||||
|
||||
liblist_cnt++;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
@ -655,6 +681,9 @@ static void sigtrap_handler(int signum, siginfo_t *si, void *context) {
|
||||
#elif defined(__FreeBSD__) && defined(__LP64__)
|
||||
ctx->uc_mcontext.mc_rip -= 1;
|
||||
addr = ctx->uc_mcontext.mc_rip;
|
||||
#elif defined(__HAIKU__) && defined(__x86_64__)
|
||||
ctx->uc_mcontext.rip -= 1;
|
||||
addr = ctx->uc_mcontext.rip;
|
||||
#else
|
||||
#error "Unsupported platform"
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user