From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 5152F3858000 for ; Fri, 3 Mar 2023 13:34:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5152F3858000 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=foss.arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2EAED143D; Fri, 3 Mar 2023 05:35:26 -0800 (PST) Received: from [10.2.78.76] (unknown [10.2.78.76]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 47E273F93E; Fri, 3 Mar 2023 05:34:42 -0800 (PST) Message-ID: <4b34f3e3-df83-b4b5-50a0-993483671df5@foss.arm.com> Date: Fri, 3 Mar 2023 13:34:41 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH][Newlib] arm: Fix the SP used in setting stack limit for standalone application. Content-Language: en-GB To: Srinath Parvathaneni , newlib@sourceware.org Cc: Richard Earnshaw References: <41d4f38f-d108-7913-97a2-c60acd11e421@arm.com> From: Richard Earnshaw In-Reply-To: <41d4f38f-d108-7913-97a2-c60acd11e421@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3488.0 required=5.0 tests=BAYES_00,BODY_8BITS,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I've tweaked the commit message and pushed (we don't use ChangeLog files in newlib). R. On 03/03/2023 12:45, Srinath Parvathaneni wrote: > Hi, > > When the processor by default starts in USER mode, in __stack_init > function of crt0.s the stack limit register is not getting set > correctly for standalone application. This is because the register r3 > used to set this stack limit register is not updated with correct stack > pointer value. This patch fixes this issue and updates r3 with correct > stack pointer value. > > Regression tested on arm-none-eabi target for newlib and newlib-nano and > found > no regressions. > > Ok for newlib master? > > Regards, > Srinath. > > libgloss/ChangeLog: > > 2023-03-03  Srinath Parvathaneni > >     * arm/crt0.S (__stack_init): Update r3 value before mode checking. > > newlib/ChangeLog: > > 2023-03-03  Srinath Parvathaneni > >     * libc/sys/arm/crt0.S (__stack_init): Update r3 value before mode >         checking.