diff options
author | Maxim Ostapenko <m.ostapenko@samsung.com> | 2016-12-02 07:39:27 +0000 |
---|---|---|
committer | Maxim Ostapenko <chefmax@gcc.gnu.org> | 2016-12-02 09:39:27 +0200 |
commit | 84b0769e335819050ecdd86301a5f5d41fa5df8b (patch) | |
tree | 9fbdf0659d0c0d3375472bd8ec482b390381fa99 /gcc/c-family | |
parent | b06496b1617ffcaec0e82fd4cca9eae5e0301cd5 (diff) | |
download | gcc-84b0769e335819050ecdd86301a5f5d41fa5df8b.zip gcc-84b0769e335819050ecdd86301a5f5d41fa5df8b.tar.gz gcc-84b0769e335819050ecdd86301a5f5d41fa5df8b.tar.bz2 |
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
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-attribs.c | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 183493d..5890798 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2016-12-02 Maxim Ostapenko <m.ostapenko@samsung.com> + + * c-attribs.c (asan odr indicator): New attribute. + (handle_asan_odr_indicator_attribute): New function. + 2016-11-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * c-common.c (c_common_nodes_and_builtins): Remove initialization of diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c index 964efe9..f5adade 100644 --- a/gcc/c-family/c-attribs.c +++ b/gcc/c-family/c-attribs.c @@ -57,6 +57,8 @@ static tree handle_no_address_safety_analysis_attribute (tree *, tree, tree, int, bool *); static tree handle_no_sanitize_undefined_attribute (tree *, tree, tree, int, bool *); +static tree handle_asan_odr_indicator_attribute (tree *, tree, tree, int, + bool *); static tree handle_stack_protect_attribute (tree *, tree, tree, int, bool *); static tree handle_noinline_attribute (tree *, tree, tree, int, bool *); static tree handle_noclone_attribute (tree *, tree, tree, int, bool *); @@ -292,6 +294,9 @@ const struct attribute_spec c_common_attribute_table[] = { "no_sanitize_undefined", 0, 0, true, false, false, handle_no_sanitize_undefined_attribute, false }, + { "asan odr indicator", 0, 0, true, false, false, + handle_asan_odr_indicator_attribute, + false }, { "warning", 1, 1, true, false, false, handle_error_attribute, false }, { "error", 1, 1, true, false, false, @@ -591,6 +596,15 @@ handle_no_sanitize_undefined_attribute (tree *node, tree name, tree, int, return NULL_TREE; } +/* Handle an "asan odr indicator" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_asan_odr_indicator_attribute (tree *, tree, tree, int, bool *) +{ + return NULL_TREE; +} + /* Handle a "stack_protect" attribute; arguments as in struct attribute_spec.handler. */ |