diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | libhfuzz/memorycmp.c | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -32,6 +32,10 @@ COMMON_SRCS := $(sort $(wildcard *.c)) CFLAGS ?= -O3 LDFLAGS ?= LIBS_CFLAGS ?= -fPIC -fno-stack-protector -fno-builtin -D__NO_STRING_INLINES -D__NO_INLINE__ +HFUZZ_USE_RET_1 ?= false +ifeq ($(HFUZZ_USE_RET_1),true) + LIBS_CFLAGS += -D_HF_USE_RET_ADDR_1 -Wno-error=frame-address +endif OS ?= $(shell uname -s) MARCH ?= $(shell uname -m) diff --git a/libhfuzz/memorycmp.c b/libhfuzz/memorycmp.c index e3c8c58b..f0599ac7 100644 --- a/libhfuzz/memorycmp.c +++ b/libhfuzz/memorycmp.c @@ -6,9 +6,9 @@ int hfuzz_module_memorycmp = 0; -#if 0 /* Might be useful with defined(__x86_64__) */ +#if defined(_HF_USE_RET_ADDR_1) /* Use mix of two previous addresses */ #define RET_CALL_CHAIN \ - ((uintptr_t)__builtin_return_address(0) & 0xFFF) | \ + ((uintptr_t)__builtin_return_address(0)) ^ \ ((uintptr_t)__builtin_return_address(1) << 12) #else #define RET_CALL_CHAIN (uintptr_t) __builtin_return_address(0) |