From patchwork Thu Sep 14 16:58:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pekka_Sepp=C3=A4nen?= X-Patchwork-Id: 139706 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp488782vqi; Thu, 14 Sep 2023 09:59:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgV7Ba7/n5QKMuBtzQ9RnvQ0QDyHtGQT28/XL0upmUvqgMp3TsO/NkPbC8oxU8vZctr+lV X-Received: by 2002:aa7:d0d4:0:b0:52f:4c92:69ee with SMTP id u20-20020aa7d0d4000000b0052f4c9269eemr5530640edo.36.1694710778281; Thu, 14 Sep 2023 09:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694710778; cv=none; d=google.com; s=arc-20160816; b=zuY+nY6S8IbXyrEtrid9lKKYvRV0LaLL7A3fQZDYO/u9TQGBqjNa7hcoL+sbWlDXaF 0BtJH49//0UU8B4SF+6JN5XMhWaaY3iWYx45AkPZn8Dz/rdN8GdR2FTOOZcXlj9oamFR opSpb9G692iaOClcTRqWJsMRi/vpXegIqVjoVJLH50N/WMOgQq7aLdu5hVpaMGV2UfEK r8euztdaNJJxmtnXnEtQ0fJUTOP++1UYQtsXcn3BCbzOh/U8XQR3glwQqsp8jhf4r6+S iET5BcF7i5cLW48KuNovIa1x68bpTzF0tTdXFgduO7kFtjDzI6ag067Bq7NpO+9Pdrz1 8Kig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :subject:from:to:content-language:mime-version:date:message-id :dkim-signature:dmarc-filter:delivered-to; bh=le1A1oTZAqdieWe2AMKo2II7kN8HyrTBnQZ1vejFDac=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=NcwFaCF5H1qqAVJCByEyVQ57mTcTjcMJPY585sykPC3OsgFRUMoFkDh8vg46OEm72b Z3FREX5uH+TMdBK08zjNT1otY9eGvPcDyhQDjG251Yi9PMSUIlwKgFdLyAuJACqF9Z1q xANNmBBM9QoOzCf6/q1JL9B6y1xQFBORaTYW5Ru/xv3zBQiqmvS/d9KIdmJ+QgAjBGqw BDHxyr8M225h8/2X6o78tP3tEfuDkce7Io7+pYo+HSFqG9nffJVCXDVljzmn8oW75shL nMpAs9ds2XZEBU4S69xlhtgXgMflSOvtqlZI3BMqyu+1jb4Wok4ULPJk1EZUL3S3Qeny g6hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=F2rKffop; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=kapsi.fi Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y2-20020a056402134200b005234b452a4fsi1631572edw.68.2023.09.14.09.59.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 09:59:38 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=F2rKffop; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=kapsi.fi Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A3EB3856DC2 for ; Thu, 14 Sep 2023 16:59:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by sourceware.org (Postfix) with ESMTPS id 6B8FB3858CDA for ; Thu, 14 Sep 2023 16:58:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B8FB3858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.mail.kapsi.fi Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kapsi.fi DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:Subject:From:To: MIME-Version:Date:Message-ID:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=le1A1oTZAqdieWe2AMKo2II7kN8HyrTBnQZ1vejFDac=; b=F2rKffopfZM2sfeF1I79sPLWXK 5biLgG+PExcCZ3lHFCpczk8zzNpUT+2NekP8NhrPc5EbVYef6c+oEbkx1euX+XgHLD2KUIrt5JBMB 4mB21sj/pHTYjXOZSRlK3QOsqZJRqzCqfZ+glpGmePBDroGeKIbuwnLrblTla/EfzVnkG2FnoRmVg RV34brzGPSvAZqzPZ+FRq1SNavjcV6xRW3/YsrhSncFrjoWHHMJCyfnlPr/tAZO3R7+jY21uYnsUd X9Gb3EdMh0vJmn4NE4jQARFviN9gHCm8mXByXgiRpqJ258kHm8911XBj7kabU9F+2+C+NXhe0E4Sn ZiSuM+8A==; Received: from 84-231-125-196.elisa-mobile.fi ([84.231.125.196] helo=[172.16.1.20]) by mail.kapsi.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1qgpg0-00C1GJ-1M for gcc-patches@gcc.gnu.org; Thu, 14 Sep 2023 19:58:48 +0300 Message-ID: <38b1578e-fc60-4c0b-bdb7-54c530246e83@gcc.mail.kapsi.fi> Date: Thu, 14 Sep 2023 19:58:47 +0300 MIME-Version: 1.0 Content-Language: en-US To: gcc-patches@gcc.gnu.org From: =?utf-8?q?Pekka_Sepp=C3=A4nen?= Subject: [PATCH] aarch64: Ensure const and sign correctness X-SA-Exim-Connect-IP: 84.231.125.196 X-SA-Exim-Mail-From: pexu@gcc.mail.kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777033048765318138 X-GMAIL-MSGID: 1777033048765318138 Be const and sign correct by using a matching CIE augmentation type. Use a builtin instead of relying being included. libgcc/ChangeLog: * config/aarch64/aarch64-unwind.h (aarch64_cie_signed_with_b_key): Use const unsigned type and a builtin. Signed-off-by: Pekka Seppänen --- libgcc/config/aarch64/aarch64-unwind.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libgcc/config/aarch64/aarch64-unwind.h b/libgcc/config/aarch64/aarch64-unwind.h index 3ad2f8239ed..d669edd671b 100644 --- a/libgcc/config/aarch64/aarch64-unwind.h +++ b/libgcc/config/aarch64/aarch64-unwind.h @@ -40,8 +40,9 @@ aarch64_cie_signed_with_b_key (struct _Unwind_Context *context) const struct dwarf_cie *cie = get_cie (fde); if (cie != NULL) { - char *aug_str = cie->augmentation; - return strchr (aug_str, 'B') == NULL ? 0 : 1; + const unsigned char *aug_str = cie->augmentation; + return __builtin_strchr ((const char *) aug_str, + 'B') == NULL ? 0 : 1; } } return 0;