From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20983 invoked by alias); 1 Nov 2012 19:53:11 -0000 Received: (qmail 20938 invoked by uid 22791); 1 Nov 2012 19:53:09 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,TW_SV X-Spam-Check-By: sourceware.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Nov 2012 19:52:54 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TU0ov-0004ao-5j for gcc-patches@gcc.gnu.org; Thu, 01 Nov 2012 15:52:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32907) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TU0ou-0004Zl-Sc for gcc-patches@gcc.gnu.org; Thu, 01 Nov 2012 15:52:53 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA1JqpGL007082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Nov 2012 15:52:51 -0400 Received: from localhost (ovpn-116-40.ams2.redhat.com [10.36.116.40]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qA1Jqogk008904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Nov 2012 15:52:51 -0400 Received: by localhost (Postfix, from userid 1000) id 0BDBF2C010B; Thu, 1 Nov 2012 20:52:47 +0100 (CET) From: dodji@redhat.com To: gcc-patches@gcc.gnu.org Cc: dnovillo@google.com, jakub@redhat.com, wmi@google.com, davidxl@google.com, konstantin.s.serebryany@gmail.com Subject: =?utf8?q?=5BPATCH=2009/13=5D=20Don=27t=20forget=20to=20protect=2032=20bytes=20aligned=20global=20variables=2E?= Date: Thu, 01 Nov 2012 19:53:00 -0000 Message-Id: <1351799566-31447-10-git-send-email-dodji@redhat.com> In-Reply-To: <1351799566-31447-1-git-send-email-dodji@redhat.com> References: <1351799566-31447-1-git-send-email-dodji@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg00091.txt.bz2 From: wmi It appeared that we were forgetting to protect global variables that are already 32 bytes aligned. Fixed thus. * varasm.c (assemble_variable): Set asan_protected even for decls that are already ASAN_RED_ZONE_SIZE or more bytes aligned. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/asan@192830 138bc75d-0d0= 4-0410-961f-82ee72b054a4 --- gcc/ChangeLog.asan | 15 +++++++++++++++ gcc/varasm.c | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog.asan b/gcc/ChangeLog.asan index 3da0a0b..57670f7 100644 --- a/gcc/ChangeLog.asan +++ b/gcc/ChangeLog.asan @@ -1,3 +1,18 @@ +2012-10-25 Wei Mi =C2=A0 + + * varasm.c (assemble_variable): Set asan_protected even=20 + for decls that are already ASAN_RED_ZONE_SIZE or more=20 + bytes aligned. + +2012-10-19 Diego Novillo + + Merge from trunk rev 192612. + +2012-10-18 Xinliang David Li + + * asan.c (asan_init_shadow_ptr_types): change shadow type + to signed type. + 2012-10-18 Jakub Jelinek =20 * asan.c (build_check_stmt): Unshare base. diff --git a/gcc/varasm.c b/gcc/varasm.c index 8a533ed..641ce0c 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1991,11 +1991,11 @@ assemble_variable (tree decl, int top_level ATTRIBU= TE_UNUSED, align_variable (decl, dont_output_data); =20 if (flag_asan - && asan_protect_global (decl) - && DECL_ALIGN (decl) < ASAN_RED_ZONE_SIZE * BITS_PER_UNIT) + && asan_protect_global (decl)) { asan_protected =3D true; - DECL_ALIGN (decl) =3D ASAN_RED_ZONE_SIZE * BITS_PER_UNIT; + DECL_ALIGN (decl) =3D MAX (DECL_ALIGN (decl),=20 + ASAN_RED_ZONE_SIZE * BITS_PER_UNIT); } =20 set_mem_align (decl_rtl, DECL_ALIGN (decl)); --=20 1.7.11.7