From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-1.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4EF73200B9 for ; Mon, 7 May 2018 02:50:04 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:in-reply-to:references:content-transfer-encoding; q=dns; s=default; b=ozuZqwvzFmf2pvTpObikE8SAPuHDDR9zD+PJa+Q3Uz/ i7CgXMMJnSr13fE12CFkcdTvp6t38D7QV/UoLcRWTaAn/DQ0/yvcIL+3xcPq35oV QOnyexYLLqKuZv8b4n2bHhdZ8jYSPobJJ532YgSG8DhQdEUYLkTGh0TFCPcRNfaY = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:in-reply-to:references:content-transfer-encoding; s=default; bh=Pyy0ItPl2C13B6EP51g1UEqokGA=; b=OZSS6Pc++NZbPSVwz HK9MHlv6WnulFS/2d2JhnhGselqrwzi71bBas7RqvX9Ds+obYNDgDE7aiMsVx6Wh 4rFifW5WdCXqSpK/8PaBSdqojauEYiw+rJZpua8jx7HvfdPhfv2V67h+R4UtsME4 CNrgwJ5uo6z/5WO8/jZJ/v/S/Q= Received: (qmail 52556 invoked by alias); 7 May 2018 02:49:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 49788 invoked by uid 89); 7 May 2018 02:49:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-HELO: l2mail1.panix.com From: Zack Weinberg To: libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org Subject: Re: [PATCH v2 01/21] powerpc: Create stackframe information on syscall Date: Sun, 6 May 2018 22:49:05 -0400 Message-Id: <20180507024909.5598-1-zackw@panix.com> MIME-Version: 1.0 In-Reply-To: <1519679016-12241-2-git-send-email-adhemerval.zanella@linaro.org> References: <1519679016-12241-2-git-send-email-adhemerval.zanella@linaro.org> Content-Transfer-Encoding: 8bit On 26 Feb 2018, Adhemerval Zanella wrote: > This patch adds a minimal stackframe creation on powerpc syscall > implementation so backtrace works correctly on a signal handler. I don't know powerpc well enough to know if this should be necessary. I think one of the powerpc arch maintainers should comment. I do have a couple questions: > +#ifdef __powerpc64__ > + stdu r1, -FRAME_MIN_SIZE (r1) > + cfi_adjust_cfa_offset (FRAME_MIN_SIZE) > +#else > + stwu r1,-16(1) > + cfi_def_cfa_offset (16) > +#endif Why does this use cfa_adjust_cfa_offset for 64-bit but _def_ for 32-bit? > +#ifdef __powerpc64__ > + addi r1, r1, FRAME_MIN_SIZE > +#else > + addi r1,r1,16 > +#endif If FRAME_MIN_SIZE were defined for ppc32, we could reduce the ifdeffage here. > + cfi_def_cfa_offset (0) > sc > PSEUDO_RET Shouldn't the stack adjustments be undone _after_ the 'sc' instruction? Actually, is it possible that a single cfi_def_cfa_offset (0) at the beginning of the function is all that's really needed here? It seems like backtrace should be able to handle leaf frames in general... zw