From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92827 invoked by alias); 5 Jul 2017 18:19:12 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 92805 invoked by uid 89); 5 Jul 2017 18:19:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=H*f:sk:3194afb, east, newlib.sourceware.narkive.com, infocenter.arm.com X-HELO: homiemail-a51.g.dreamhost.com Received: from sub5.mail.dreamhost.com (HELO homiemail-a51.g.dreamhost.com) (208.113.200.129) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Jul 2017 18:19:10 +0000 Received: from homiemail-a51.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a51.g.dreamhost.com (Postfix) with ESMTP id 5F2836004A0D; Wed, 5 Jul 2017 11:19:09 -0700 (PDT) Received: from [192.168.1.7] (pool-72-74-171-167.bstnma.fios.verizon.net [72.74.171.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: drn@nadler.com) by homiemail-a51.g.dreamhost.com (Postfix) with ESMTPSA id EA42D6004A11; Wed, 5 Jul 2017 11:19:08 -0700 (PDT) From: Dave Nadler Subject: Re: [Newlib][libgloss]ARM - semihosting use of __end__symbol in crt0.S To: Tamar Christina , "newlib@sourceware.org" Cc: nd References: <20170705083621.GB30902@calimero.vinschen.de> <3194afba-248d-a10e-1393-91bfbe744d43@nadler.com> Message-ID: <91886142-6bd1-54cd-6bc7-3f00569a3e60@nadler.com> Date: Wed, 05 Jul 2017 18:19:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00571.txt.bz2 Thanks Tamar - but, what is the heap base address _used_ for in semihosting? The heap storage is allocated starting during early start-up; so hopefully it is not trying to use this memory... Thanks! Best Regards, Dave On 7/5/2017 11:16 AM, Tamar Christina wrote: > Hi Dave, > > The use of __end__ relates to the semihosting call SYS_HEAPINFO. > Likely the link originally pointed tohttp://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471f/Bacbefaa.html. > > Basically at the startup r0 will contain the given 4 byte structure, where the first entry is the heap_base. > If this is 0 it means the system was unable to calculate it. > __end__ is then used as a fall back for this. > The reason __end__ is used instead of __bss_end___ has to do with the alignment requirements. > > The same question was asked on the bug-fix patch that introduced it: > http://newlib.sourceware.narkive.com/bcyUamAh/rfa-libgloss-arm-handle-zero-heap-base-from-semihosting > > I am not completely certain, but this seems to indicate that not all of semihosting is supported on systems with multiple stacks. > > Cheers, > Tamar > ________________________________________ > From: Dave Nadler > Sent: Wednesday, July 5, 2017 2:32:18 PM > To: Tamar Christina;newlib@sourceware.org > Cc: nd > Subject: [Newlib][libgloss]ARM - semihosting use of __end__symbol in crt0.S > > Hi Tamar - Perhaps as you are working on ARM crt0 and semihosting, you > can help > with a question regarding crt0's use of the symbol __end__ for semihosting. > I read the code but I'm not expert at ARM assembly and do not understand > what __end__ is being used for, and the comments do not explain the > intent/purpose... > > I am concerned that there is an assumption within semihosting about > available memory or memory boundaries that may be incorrect in systems where > heap and stack are not contiguous, for example embedded systems with multiple > stacks. > > I asked the question on stack exchange but (surprise) didn't get any > useful response: > https://stackoverflow.com/questions/44853442/meaning-of-gnu-symbol-end-especially-arm-embedded > > Thanks in advance for any clarification, > Best Regards, Dave -- Dave Nadler, USA East Coast voice (978) 263-0097,drn@nadler.com, Skype Dave.Nadler1