Commit Graph

6 Commits

Author SHA1 Message Date
Maxim Ostapenko 84b0769e33 Add support for ASan odr_indicator.
config/

        * bootstrap-asan.mk: Replace LSAN_OPTIONS=detect_leaks=0 with
        ASAN_OPTIONS=detect_leaks=0:use_odr_indicator=1.

gcc/

        * asan.c (asan_global_struct): Refactor.
        (create_odr_indicator): New function.
        (asan_needs_odr_indicator_p): Likewise.
        (is_odr_indicator): Likewise.
        (asan_add_global): Introduce odr_indicator_ptr. Pass it into global's
        constructor.
        (asan_protect_global): Do not protect odr indicators.

gcc/c-family/

	* c-attribs.c (asan odr indicator): New attribute.
	(handle_asan_odr_indicator_attribute): New function.

gcc/testsuite/

        * c-c++-common/asan/no-redundant-odr-indicators-1.c: New test.

From-SVN: r243153
2016-12-02 09:39:27 +02:00
Max Ostapenko 89e302b80c libsanitizer merge from upstream r250806, compiler part.
gcc/

	* asan.c (asan_emit_stack_protection): Don't pass local stack to
	asan_stack_malloc_[n] anymore. Check if asan_stack_malloc_[n] returned
	NULL and use local stack than.
	(asan_finish_file): Insert __asan_version_mismatch_check_v[n] call
	in addition to __asan_init.
	* sanitizer.def (BUILT_IN_ASAN_INIT): Rename to __asan_init.
	(BUILT_IN_ASAN_VERSION_MISMATCH_CHECK): Add new builtin call.
	* asan.h (asan_intercepted_p): Handle new string builtins.
	* ubsan.c (ubsan_use_new_style_p): New function.
	(ubsan_instrument_float_cast): If location is unknown, assign
	input_location to loc. Propagate loc to ubsan_create_data if
	ubsan_use_new_style_p returned true.

config/

	* bootstrap-asan.mk: Replace ASAN_OPTIONS=detect_leaks with
	LSAN_OPTIONS=detect_leaks.

gcc/testsuite/

	* c-c++-common/ubsan/float-cast-overflow-10.c: Adjust test.
	* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
	* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
	* g++.dg/asan/default-options-1.C: Likewise.

From-SVN: r229112
2015-10-21 10:40:54 +03:00
H.J. Lu 5a4e7cade9 Export "detect_leaks=0"
PR bootstrap/63888
	* bootstrap-asan.mk (ASAN_OPTIONS): Export "detect_leaks=0".

From-SVN: r217678
2014-11-17 14:12:55 -08:00
H.J. Lu 913e2f0a00 Add -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/
* bootstrap-asan.mk (POSTSTAGE1_LDFLAGS): Add
	-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/.

From-SVN: r205539
2013-11-29 10:10:21 -08:00
H.J. Lu fbf1afa422 Add -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/
* bootstrap-asan.mk (POSTSTAGE1_LDFLAGS): Add
	-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.

From-SVN: r196264
2013-02-25 08:18:39 -08:00
H.J. Lu 1d02988986 Add the missing file
From-SVN: r193942
2012-11-29 09:00:38 -08:00