From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689689758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=u0PnRKGkPlhZ0QbwGjwu+SLM1kGvwXUz3fT3C4yEc4U=; b=Uuf/Rtxz8izKAJaxIdX0iLFqNP8Bv/E0vhSyV3G++ou3pCTvHK2sF6/H/3tIjVOHboLLLq j4tj9vc9hmkCmxsQ2PbXFeUM4XXJEGdSuOTlBG38GxkT51eu9lgejyCajcD268aEn4C9GM VMHR9xc4iRO5GAVEPWh6BXlTfHXaCys= 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) From: Florian Weimer 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 Content-Type: text/plain 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 List-Id: 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(-) 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, base-commit: a1322d76ca1c3c914fb818d9ba3edc291ccfa25e -- 2.41.0