From patchwork Tue Jul 18 14:15:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 122062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1781618vqt; Tue, 18 Jul 2023 07:19:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlGAmv2E2lUanjct66dCKDALfYvreq8V7FWf9wgk6YqUYoPOCWJG/IzFwQ/TZhSU0yP/FisL X-Received: by 2002:a17:907:78c2:b0:994:3207:cddd with SMTP id kv2-20020a17090778c200b009943207cdddmr51495ejc.34.1689689978090; Tue, 18 Jul 2023 07:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689689978; cv=none; d=google.com; s=arc-20160816; b=G6itIEpoxVPg08KwReTbwyiZt7w0XmVgmeauWu80Hfd/wpGitincYeL4zgyGQEVYrD YgIH00VWX9c6j83XI8zwE/KrWVVGbmlSJe+DroDOp0F4ozSm6OptM08ArFqpgBCR9X5i t99L055Poo4JRZLWiUYA7yoytjI0YXFf70guMilamdbrX93xLUxop7cdpGu1eMkFvC6C qasK+tjoNdMupFwv9O0HxQ3P4svcFu5ybWf7uLWCTK0py6dgmnYsOjgzv+GfkaKvi+50 2/YiH4h5CdTafnviCVeMrVVYBzl6YuZgQbNi8YK7wW88VxQ1jXVVRb48Sd8i8/UKLSUr cgig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:date:message-id:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=u0PnRKGkPlhZ0QbwGjwu+SLM1kGvwXUz3fT3C4yEc4U=; fh=41Jd4gXEdp8RTPlluDRE3c11GGV4DWL61bXnhTaoXBQ=; b=TCT0GR3IMtonx4egfjBb7SH/+qFN8mMNwydUxhXd0/Ms4U6hsZT4UMQZ7vO1HY+DTc b+68N23Z13RuOaObmMR/EKQ9dZuohaUC6mKWWwMHyDDAKaArEyRFM3bVe1d71COxG6h+ 8ShBdHhkcRw1tMUSSxO4UE/ZNECnjQtRC0aLpWbqs5kYNjmNeH6RmfJ8cItzkVuTRvWA v7xbNZ/ROtwrsucvyal2s/SNwrZ+g92qwOcRfpjZBdc3B5lzJJ7MadPp0JJ0xGdt3ejH 8O8UGuEFvynzsTXv/ICAMWJdwEPcDP08sLkJi9MaUqOqFZl2Gpwcgdit3ZM3gwI9266U u64A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=MGXo2+U6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id pj25-20020a170906d79900b0098e42bef73asi1260702ejb.98.2023.07.18.07.19.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 07:19: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=pass header.i=@gcc.gnu.org header.s=default header.b=MGXo2+U6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 965F8383906F for ; Tue, 18 Jul 2023 14:18:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 965F8383906F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689689882; bh=u0PnRKGkPlhZ0QbwGjwu+SLM1kGvwXUz3fT3C4yEc4U=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=MGXo2+U68Whw7ON60Yh4vGtsILs6mDncSaibMyEzqnpHpCsdhDqPn63x/lzPnakPt aws4NbPTIQVVPx5U4y5qKdnzlL7o6bDHD6QeR8kuZAtGi5EX1R98Ps6A6+5JJsTj0+ 3+VgVn4CD3KjSFolvji/6zmp9f+sHZIOZrnrLBJ8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 60417385AF97 for ; Tue, 18 Jul 2023 14:15:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 60417385AF97 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-493-u6iwJXptNrGHZYVBV1b0VA-1; Tue, 18 Jul 2023 10:15:56 -0400 X-MC-Unique: u6iwJXptNrGHZYVBV1b0VA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4AD91C0905C for ; Tue, 18 Jul 2023 14:15:42 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45EB0409BE82 for ; Tue, 18 Jul 2023 14:15:42 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH releases/gcc-13 1/2] libgcc: Fix eh_frame fast path in find_fde_tail Message-ID: <7302f8a2fa2f95252b32de2dc826591e75230662.1689689650.git.fweimer@redhat.com> X-From-Line: 7302f8a2fa2f95252b32de2dc826591e75230662 Mon Sep 17 00:00:00 2001 Date: Tue, 18 Jul 2023 16:15:40 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Gcc-patches From: Florian Weimer Reply-To: Florian Weimer Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771768358674237573 X-GMAIL-MSGID: 1771768358674237573 The eh_frame value is only used by linear_search_fdes, not the binary search directly in find_fde_tail, so the bug is not immediately apparent with most programs. Fixes commit e724b0480bfa5ec04f39be8c7290330b495c59de ("libgcc: Special-case BFD ld unwind table encodings in find_fde_tail"). libgcc/ PR libgcc/109712 * unwind-dw2-fde-dip.c (find_fde_tail): Correct fast path for parsing eh_frame. (cherry picked from commit 49310a993308492348119f4033e4db0bda4fe46a) --- libgcc/unwind-dw2-fde-dip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: a1322d76ca1c3c914fb818d9ba3edc291ccfa25e diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c index 6223f5f18a2..4e0b880513f 100644 --- a/libgcc/unwind-dw2-fde-dip.c +++ b/libgcc/unwind-dw2-fde-dip.c @@ -403,8 +403,8 @@ find_fde_tail (_Unwind_Ptr pc, BFD ld generates. */ signed value __attribute__ ((mode (SI))); memcpy (&value, p, sizeof (value)); + eh_frame = p + value; p += sizeof (value); - dbase = value; /* No adjustment because pcrel has base 0. */ } else p = read_encoded_value_with_base (hdr->eh_frame_ptr_enc, From patchwork Tue Jul 18 14:15:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 122061 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1780496vqt; Tue, 18 Jul 2023 07:18:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlElJDY0NjD4WwLdXUvuflyrflZLpWHMKxxKpuGYoIONtwvIljDuQsdHP0uds1EOvkN//HwW X-Received: by 2002:a17:906:5c:b0:997:eac2:65d2 with SMTP id 28-20020a170906005c00b00997eac265d2mr16114ejg.54.1689689884172; Tue, 18 Jul 2023 07:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689689884; cv=none; d=google.com; s=arc-20160816; b=ZWbwizQvw5vtncwZNf5S3QkS3AKKDtB7Uv/fYCDAFtO9cTYSaWCV4VXJLdB35a6J1b rl4ZilSavW0n5aJds1lhV2B8ogC8m8nsUsRyOFY7D3BlPB1AU/1Q354B9CbG7DWexkMz Z07L5hNGUG0XWCKILLLosPSvYcymPGLgioKklN76jS+62aA+GNE4+dM9sX/Drb0He3em mjD7oiDImtPI9O4mzQeSzhVFSPBI2VV/GcahIt7LE41tKRyjtKah4yWj214DOJcA6dSU 2gRdHXxq8ugsB2uZyhwIEo47PNBhDoAHFbTqLMt58s7F6Yc1q8uk2q5tCvYq5pKvZmY+ VRvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:date:references:message-id:in-reply-to:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=wt5llva0UV8ljR6mAezoKiDf7D2npVGnSGNaiOeNJ1M=; fh=41Jd4gXEdp8RTPlluDRE3c11GGV4DWL61bXnhTaoXBQ=; b=kT6+uJUgs0H5uaWcMQUf9J68qUzTv84o3T6IC3PBUkCXpdEVK8KBGhCC+HEYb/g41h U/ot7bpHhLcI0snUsdEhvKZ++TgD2QnRB0j3pJQvmCF1OoSRmRVLUCP284n/Lt1haJaI DROIS4CPBT7i6anVQFJ6YjhWRKiV415WuVdTKhtmoOzSQsEwbIgvS9CoQ8RJkyShqozY wjW8AQhmcp2jQe1VzNgWmCG+pZ48T/PKaz9bAEto3c4oBrsi0sOdOoVD7C0zfIRdlTjP 3ALSanQNjTGSiAldSIZADz7v9HKM2lHUaR1V9AoacTCLNBYSUg/lytKff00CCOolVC+B ElnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kbnBGinN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id pk13-20020a170906d7ad00b0099251942e1bsi1228091ejb.82.2023.07.18.07.18.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 07:18:04 -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=pass header.i=@gcc.gnu.org header.s=default header.b=kbnBGinN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 293C43870929 for ; Tue, 18 Jul 2023 14:16:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 293C43870929 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689689816; bh=wt5llva0UV8ljR6mAezoKiDf7D2npVGnSGNaiOeNJ1M=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=kbnBGinNjdBZzg8RZ7mHvYVss6YJENZR0JGXEPQVUF1oYwyjcZpW2XmwU33Fkegj+ fbKS7V0YqQVJe3idIvv/yYbp7YorrwERdCY7fy/B5ps1JGo4YdyFaE/3dJmv59MMye HJW7dNxBgj7jpfbjf8ySt56HA76497o78MuV4L3o= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CBEF5385C6DC for ; Tue, 18 Jul 2023 14:16:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBEF5385C6DC Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-347-R4_GkaU5MGeyUjlJXVrUug-1; Tue, 18 Jul 2023 10:16:07 -0400 X-MC-Unique: R4_GkaU5MGeyUjlJXVrUug-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B980D830DB6 for ; Tue, 18 Jul 2023 14:15:46 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5FC044CD0FC for ; Tue, 18 Jul 2023 14:15:46 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH releases/gcc-13 2/2] libgcc: Fix -Wint-conversion warning in find_fde_tail In-Reply-To: <7302f8a2fa2f95252b32de2dc826591e75230662.1689689650.git.fweimer@redhat.com> Message-ID: <6f9dfb4d759146eebf7f88ad519010ea2191bf3a.1689689650.git.fweimer@redhat.com> References: <7302f8a2fa2f95252b32de2dc826591e75230662.1689689650.git.fweimer@redhat.com> X-From-Line: 6f9dfb4d759146eebf7f88ad519010ea2191bf3a Mon Sep 17 00:00:00 2001 Date: Tue, 18 Jul 2023 16:15:45 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Gcc-patches From: Florian Weimer Reply-To: Florian Weimer Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771768259870140966 X-GMAIL-MSGID: 1771768259870140966 Fixes commit r14-1614-g49310a99330849 ("libgcc: Fix eh_frame fast path in find_fde_tail"). libgcc/ PR libgcc/110179 * unwind-dw2-fde-dip.c (find_fde_tail): Add cast to avoid implicit conversion of pointer value to integer. (cherry picked from commit 104b09005229ef48a79a33511ea192bb3ec3c415) --- libgcc/unwind-dw2-fde-dip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c index 4e0b880513f..28ea0e64e0e 100644 --- a/libgcc/unwind-dw2-fde-dip.c +++ b/libgcc/unwind-dw2-fde-dip.c @@ -403,7 +403,7 @@ find_fde_tail (_Unwind_Ptr pc, BFD ld generates. */ signed value __attribute__ ((mode (SI))); memcpy (&value, p, sizeof (value)); - eh_frame = p + value; + eh_frame = (_Unwind_Ptr) (p + value); p += sizeof (value); } else