aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Ostapenko <m.ostapenko@samsung.com>2017-01-13 10:08:50 +0000
committerMaxim Ostapenko <chefmax@gcc.gnu.org>2017-01-13 12:08:50 +0200
commit0acd830b7e91e5b2d0e20fd0f5770544fd5f16ab (patch)
treec21a9aadf4bd45797940ed35147ffa12bdaab8f0
parent582dbb53ac6d0bd46c1402584d2c4be0a34a040b (diff)
downloadgcc-0acd830b7e91e5b2d0e20fd0f5770544fd5f16ab.zip
gcc-0acd830b7e91e5b2d0e20fd0f5770544fd5f16ab.tar.gz
gcc-0acd830b7e91e5b2d0e20fd0f5770544fd5f16ab.tar.bz2
re PR sanitizer/78887 (Failure to build aarch64 allmodconfig Linux kernel 4.9)
PR sanitizer/78887 * asan.c (asan_needs_odr_indicator_p): Don't emit ODR indicators if -fsanitize=kernel-address is present. From-SVN: r244402
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/asan.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d79749e..7aebebc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-13 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR sanitizer/78887
+ * asan.c (asan_needs_odr_indicator_p): Don't emit ODR indicators
+ if -fsanitize=kernel-address is present.
+
2017-01-13 Richard Biener <rguenther@suse.de>
* tree-pretty-print.c (dump_generic_node): Dump INTEGER_CSTs
diff --git a/gcc/asan.c b/gcc/asan.c
index bc7ebc8..7450044 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -2360,7 +2360,16 @@ create_odr_indicator (tree decl, tree type)
static bool
asan_needs_odr_indicator_p (tree decl)
{
- return !DECL_ARTIFICIAL (decl) && !DECL_WEAK (decl) && TREE_PUBLIC (decl);
+ /* Don't emit ODR indicators for kernel because:
+ a) Kernel is written in C thus doesn't need ODR indicators.
+ b) Some kernel code may have assumptions about symbols containing specific
+ patterns in their names. Since ODR indicators contain original names
+ of symbols they are emitted for, these assumptions would be broken for
+ ODR indicator symbols. */
+ return (!(flag_sanitize & SANITIZE_KERNEL_ADDRESS)
+ && !DECL_ARTIFICIAL (decl)
+ && !DECL_WEAK (decl)
+ && TREE_PUBLIC (decl));
}
/* Append description of a single global DECL into vector V.