From patchwork Wed Mar 13 09:21:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1055978 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-497806-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ZWSmPt0R"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44K5vf4hzYz9s00 for ; Wed, 13 Mar 2019 20:22:06 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=DowvD/Aa4vUTzRgM l1tL5N8ZoRGYB7eYsgoVHuA835MPTz7XSw+Tcbk2acavcfS8d70PNmD8uoY7Fr0y NMhWcj4+TOQhbpglELQOvOyjj8EqtjEJOspvnNEbBEwD3OjeS72D/q8GSHrNS26J lNdRwm4RMPwwSAx0hghOA88ioF0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=F+Z6rasbZIWmtSBXL1FY1m v+DJM=; b=ZWSmPt0RmT4JRrB7niFzB9TN/Mq9FH4gmiLMbmbXXwpN5miaToBRjA TBLpO3CZSHapWToeS9RcVRnCvKfmZK+UDI0Faa4KNaAHlWZ4841zbFHY7D3vE5xH MpBRdA2Ily4JM+sfpCknw2cbFnzx/ab46GdGBjO58fApDn9t9LZq0= Received: (qmail 2005 invoked by alias); 13 Mar 2019 09:22:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 1990 invoked by uid 89); 13 Mar 2019 09:21:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Mar 2019 09:21:58 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id E0A95815A8 for ; Wed, 13 Mar 2019 10:21:56 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T-1CfRlbSoQh for ; Wed, 13 Mar 2019 10:21:56 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id B68DA8139E for ; Wed, 13 Mar 2019 10:21:56 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [libsanitizer] AddressSanitizer: fix for SPARC with GCC Date: Wed, 13 Mar 2019 10:21:56 +0100 Message-ID: <3903998.RHMxXVOS9R@polaris> MIME-Version: 1.0 This patch contains a fixlet for the AddressSanitizer on the SPARC with GCC, which would otherwise generate a problematic call to the intercepted memcpy routine. It only affects the SPARC ports and has been tested on SPARC/Solaris and SPARC64/Linux. It merges r355979 of the LLVM repository. Installed on the mainline. 2019-03-13 Eric Botcazou PR sanitizer/80953 Merge from LLVM revision 355979 * asan/asan_globals.c (GetGlobalsForAddress): Use internal_memcpy to copy Global objects for SPARC with GCC. Index: asan/asan_globals.cc =================================================================== --- asan/asan_globals.cc (revision 269546) +++ asan/asan_globals.cc (working copy) @@ -112,7 +112,11 @@ int GetGlobalsForAddress(uptr addr, Glob if (flags()->report_globals >= 2) ReportGlobal(g, "Search"); if (IsAddressNearGlobal(addr, g)) { +#if defined(__GNUC__) && defined(__sparc__) + internal_memcpy(&globals[res], &g, sizeof(g)); +#else globals[res] = g; +#endif if (reg_sites) reg_sites[res] = FindRegistrationSite(&g); res++;