From patchwork Thu Jun 3 16:42:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Seija K." X-Patchwork-Id: 1487352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=nFRchdpP; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FwsCX2N4Xz9sCD for ; Fri, 4 Jun 2021 02:43:20 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B5352386FC20 for ; Thu, 3 Jun 2021 16:43:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B5352386FC20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1622738597; bh=HWv59ZoA+vKoN1dWxu3ZsIq0Xqp0ijsjdhXYsUASoms=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=nFRchdpPCEX0+hjuoiexyyZ3mtJgZGeaLoMudjtsfSCxAH0FFcPZuMQU+BH9lf085 obpsNi9ofuy82KnAeIi++U6zG12RlA14mZH4AhPROBPca+1antG88a9yTD+z3iYVhQ KhKi8Tcr2oGT5r1ZptsrO0y1cN5CTILPgBwnSXdc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id 34375398E44D for ; Thu, 3 Jun 2021 16:42:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 34375398E44D Received: by mail-lf1-x135.google.com with SMTP id a2so9798160lfc.9 for ; Thu, 03 Jun 2021 09:42:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=WmVImUK2PzBuwYtzccS2BAFgOpilStLzLhjfUBfCLug=; b=dMUsoYDYdswva3Qp7MyhgOq6X/KXAsr2w6I9xoQYi9rqizEe3N2N8Vae28QxC65VJg 7RnZQ7tzsKEHgrOP7jDxjNZte9KNmaiXXfTkV2KjNPVCCyMtm0F328dTUtp6VqEK9YWQ KckxjZOk5Gr4xgB0zefALYPgOIK3ScZDrJVMtFiN+lzAah6ZCag9jiFvF2z+nBvzHfPe posQZZr8Y16awU6ju5OUC8/O7onvBJpm4KG7zYHlW5nHPIeWV8Eyz9nXrDBN4WQ7JLJV 3b8e2i+/aiIEKbVCoYJYdCSUs0lHfrFON0fk98zjmOq6OnAFsN0FjlVgVLO5om7KnMaO ej7w== X-Gm-Message-State: AOAM533HwC8m+9dlvGP9OuoeAfVvgd+nUXcuyhD8tXGVT9n1AYzpFCbd bGGp6+KVfx6MLpF4AFOYXWUDoEWMLZcE8TQFj691UAQP499X X-Google-Smtp-Source: ABdhPJwdx1Semz6Sd5v3vlqWeAOG4F8azWDAGySps509ttFQNpy5/lpTlLuH/B81d7fCGN6hGqEPiX7M6lnNHc1R3cE= X-Received: by 2002:a05:6512:b1e:: with SMTP id w30mr380022lfu.292.1622738538674; Thu, 03 Jun 2021 09:42:18 -0700 (PDT) MIME-Version: 1.0 Date: Thu, 3 Jun 2021 12:42:07 -0400 Message-ID: Subject: [PATCH] libgcc: Fix _Unwind_Backtrace() for SEH To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: "Seija K. via Gcc-patches" From: "Seija K." Reply-To: "Seija K." Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Forgot to assign to gcc_context.cfa and gcc_context.ra. Note this fix can be backported to earlier editions of gcc as well diff --git a/libgcc/unwind-seh.c b/libgcc/unwind-seh.c index 8c6aade9a3b39..d40d16702a9e1 100644 --- a/libgcc/unwind-seh.c +++ b/libgcc/unwind-seh.c @@ -466,6 +466,9 @@ _Unwind_Backtrace(_Unwind_Trace_Fn trace, &gcc_context.disp->HandlerData, &gcc_context.disp->EstablisherFrame, NULL); + gcc_context.cfa = ms_context.Rsp; + gcc_context.ra = ms_context.Rip; + /* Call trace function. */ if (trace (&gcc_context, trace_argument) != _URC_NO_REASON) return _URC_FATAL_PHASE1_ERROR;