asan.c (asan_finish_file): Align asan globals array by shadow granularity.
authorMaxim Ostapenko <m.ostapenko@samsung.com>
Mon, 30 Oct 2017 11:09:44 +0000 (11:09 +0000)
committerMaxim Ostapenko <chefmax@gcc.gnu.org>
Mon, 30 Oct 2017 11:09:44 +0000 (13:09 +0200)
2017-10-30  Maxim Ostapenko  <m.ostapenko@samsung.com>

* asan.c (asan_finish_file): Align asan globals array by shadow
granularity.

From-SVN: r254214

gcc/ChangeLog
gcc/asan.c

index 680033348f11ca88d85ac35b061a0bce9e6aa07b..3e38a8ecc6e0b1c1a4c7586fd10c38e35f0b3dfa 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-30  Maxim Ostapenko  <m.ostapenko@samsung.com>
+
+       * asan.c (asan_finish_file): Align asan globals array by shadow
+       granularity.
+
 2017-10-30  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/22141
index 302ac4fcdecf20899c561a6124f6158b757c1cc3..d5128aaad3729666ca400f9372e83582f3f7c38a 100644 (file)
@@ -2942,6 +2942,9 @@ asan_finish_file (void)
       TREE_CONSTANT (ctor) = 1;
       TREE_STATIC (ctor) = 1;
       DECL_INITIAL (var) = ctor;
+      SET_DECL_ALIGN (var, MAX (DECL_ALIGN (var),
+                               ASAN_SHADOW_GRANULARITY * BITS_PER_UNIT));
+
       varpool_node::finalize_decl (var);
 
       tree fn = builtin_decl_implicit (BUILT_IN_ASAN_REGISTER_GLOBALS);