2016-06-02 13:48:02 +08:00
|
|
|
//===- FuzzerExtFunctions.def - External functions --------------*- C++ -* ===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// This defines the external function pointers that
|
|
|
|
// ``fuzzer::ExternalFunctions`` should contain and try to initialize. The
|
|
|
|
// EXT_FUNC macro must be defined at the point of inclusion. The signature of
|
|
|
|
// the macro is:
|
|
|
|
//
|
|
|
|
// EXT_FUNC(<name>, <return_type>, <function_signature>, <warn_if_missing>)
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// Optional user functions
|
|
|
|
EXT_FUNC(LLVMFuzzerInitialize, int, (int *argc, char ***argv), false);
|
|
|
|
EXT_FUNC(LLVMFuzzerCustomMutator, size_t,
|
|
|
|
(uint8_t * Data, size_t Size, size_t MaxSize, unsigned int Seed),
|
|
|
|
false);
|
2016-06-08 04:22:15 +08:00
|
|
|
EXT_FUNC(LLVMFuzzerCustomCrossOver, size_t,
|
|
|
|
(const uint8_t * Data1, size_t Size1,
|
|
|
|
const uint8_t * Data2, size_t Size2,
|
|
|
|
uint8_t * Out, size_t MaxOutSize, unsigned int Seed),
|
|
|
|
false);
|
2016-06-02 13:48:02 +08:00
|
|
|
|
2016-06-08 07:32:50 +08:00
|
|
|
// Sanitizer functions
|
|
|
|
EXT_FUNC(__lsan_enable, void, (), false);
|
|
|
|
EXT_FUNC(__lsan_disable, void, (), false);
|
|
|
|
EXT_FUNC(__lsan_do_recoverable_leak_check, int, (), false);
|
2016-06-17 04:17:41 +08:00
|
|
|
EXT_FUNC(__sanitizer_install_malloc_and_free_hooks, int,
|
|
|
|
(void (*malloc_hook)(const volatile void *, size_t),
|
|
|
|
void (*free_hook)(const volatile void *)),
|
|
|
|
false);
|
2017-03-16 07:27:53 +08:00
|
|
|
EXT_FUNC(__sanitizer_print_memory_profile, int, (size_t, size_t), false);
|
2016-06-08 07:32:50 +08:00
|
|
|
EXT_FUNC(__sanitizer_print_stack_trace, void, (), true);
|
2016-08-26 06:35:08 +08:00
|
|
|
EXT_FUNC(__sanitizer_symbolize_pc, void,
|
|
|
|
(void *, const char *fmt, char *out_buf, size_t out_buf_size), false);
|
2016-12-10 09:19:35 +08:00
|
|
|
EXT_FUNC(__sanitizer_get_module_and_offset_for_pc, int,
|
|
|
|
(void *pc, char *module_path,
|
|
|
|
size_t module_path_len,void **pc_offset), false);
|
2016-06-08 07:32:50 +08:00
|
|
|
EXT_FUNC(__sanitizer_set_death_callback, void, (void (*)(void)), true);
|
|
|
|
EXT_FUNC(__sanitizer_set_report_fd, void, (void*), false);
|
2017-01-21 07:35:29 +08:00
|
|
|
EXT_FUNC(__sanitizer_dump_coverage, void, (const uintptr_t *, uintptr_t),
|
|
|
|
false);
|