From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 91863385C6C7; Wed, 7 Jun 2023 15:55:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91863385C6C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686153351; bh=1isvjLFYkzhr8RE+4u4muK2LADAHEDg4GtuXBE4z4Dk=; h=From:To:Subject:Date:From; b=vRrdZUcBO50xbW1eb7b5XtWIn1B+e7RPcKfTJumdTPhQ6gIJB9Wcd6n3n0jmE/Bg/ Ok+KOm22flIfUvaeF0HMd0/GQ6PzMDUNJ83Xt6uxgikJIDql0jwwX4OQtXsjplp3Kj 8YZrsySB694hYz+Thl8wwm0uHAjyuCNDywCfDrPw= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Florian Weimer To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1614] libgcc: Fix eh_frame fast path in find_fde_tail X-Act-Checkin: gcc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: b6235dbcfc31434bf3081f3b772dfed96eddd28d X-Git-Newrev: 49310a993308492348119f4033e4db0bda4fe46a Message-Id: <20230607155551.91863385C6C7@sourceware.org> Date: Wed, 7 Jun 2023 15:55:51 +0000 (GMT) List-Id: https://gcc.gnu.org/g:49310a993308492348119f4033e4db0bda4fe46a commit r14-1614-g49310a993308492348119f4033e4db0bda4fe46a Author: Florian Weimer Date: Tue Jun 6 11:01:07 2023 +0200 libgcc: Fix eh_frame fast path in find_fde_tail 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. Diff: --- 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,