diff options
author | Robert Swiecki <robert@swiecki.net> | 2017-12-19 01:04:35 +0100 |
---|---|---|
committer | Robert Swiecki <robert@swiecki.net> | 2017-12-19 01:04:35 +0100 |
commit | b7071738c37446c5f9f533d7e4664869770c38a3 (patch) | |
tree | 3715642f691998d700c385f8effe78abf71b0bfe | |
parent | ad95f5c98130b3f100970a3e55ff8e00bf670f54 (diff) | |
download | honggfuzz-b7071738c37446c5f9f533d7e4664869770c38a3.tar.gz |
Makefile: support _HF_USE_RET_ADDR_1
-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) |