[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
2017-02-01 04:23:21 +08:00
|
|
|
//===-- sanitizer_common_interface.inc ------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Sanitizer Common interface list.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_annotate_contiguous_container)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_contiguous_container_find_bad_address)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_set_death_callback)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_set_report_path)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_set_report_fd)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_verify_contiguous_container)
|
|
|
|
INTERFACE_WEAK_FUNCTION(__sanitizer_report_error_summary)
|
|
|
|
INTERFACE_WEAK_FUNCTION(__sanitizer_sandbox_on_notify)
|
2017-02-08 14:31:56 +08:00
|
|
|
// Sanitizer weak hooks
|
|
|
|
INTERFACE_WEAK_FUNCTION(__sanitizer_weak_hook_memcmp)
|
|
|
|
INTERFACE_WEAK_FUNCTION(__sanitizer_weak_hook_strcmp)
|
|
|
|
INTERFACE_WEAK_FUNCTION(__sanitizer_weak_hook_strncmp)
|
|
|
|
INTERFACE_WEAK_FUNCTION(__sanitizer_weak_hook_strstr)
|
[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
2017-02-01 04:23:21 +08:00
|
|
|
// Stacktrace interface.
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_get_module_and_offset_for_pc)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_symbolize_global)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_symbolize_pc)
|
|
|
|
// Allocator interface.
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_get_allocated_size)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_get_current_allocated_bytes)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_get_estimated_allocated_size)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_get_free_bytes)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_get_heap_size)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_get_ownership)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_get_unmapped_bytes)
|
|
|
|
INTERFACE_FUNCTION(__sanitizer_install_malloc_and_free_hooks)
|
|
|
|
INTERFACE_WEAK_FUNCTION(__sanitizer_free_hook)
|
|
|
|
INTERFACE_WEAK_FUNCTION(__sanitizer_malloc_hook)
|
|
|
|
INTERFACE_WEAK_FUNCTION(__sanitizer_print_memory_profile)
|