This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Newlib][libgloss]ARM - semihosting use of __end__symbol in crt0.S


Hi Dave,

The use of __end__ relates to the semihosting call SYS_HEAPINFO.
Likely the link originally pointed to http://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 <drn@nadler.com>
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


On 7/5/2017 4:44 AM, Tamar Christina wrote:
> Hi Corinna,
>
> Ah sure, I will resend them today.
>
> Thanks,
> Tamar
> ________________________________________
> From:newlib-owner@sourceware.org  <newlib-owner@sourceware.org>  on behalf of Corinna Vinschen<vinschen@redhat.com>
> Sent: Wednesday, July 5, 2017 9:36:21 AM
> To:newlib@sourceware.org
> Subject: Re: [PATCH][Newlib][libgloss] - Semihosting v2 general build changes (1 / 5)
>
> Hi Tamar,
>
> On Jul  3 16:53, Tamar Christina wrote:
>> Hi All,
>>
>>
>> This patch adds the general build system changes needed
>> in order to compile and create the new libraries for Semihosting v2.
>>
>> This works by creating a similar recursive make target that is modeled
>> after the existing multilib makefile config-ml.in.
>>
>> OK for master?
>>
>> PS. I do not have commit rights so if OK can someone apply for me?
>>
>> Thanks,
>> Tamar
>>
>>
>> libgloss/
>> 2017-07-03  Tamar Christina<tamar.christina@arm.com>
>>
>>        * multi-build.in (multi-do): New.
> We don't use ChangeLog format anymore.  Rather we would prefer
> informative git commit messages and patches in `git format-patch'
> format.
>
> These 5 patches qualify as patch series, so it would be nice if
> you could resend them that way.
>
>
> Thanks,
> Corinna
>
> --
> Corinna Vinschen
> Cygwin Maintainer
> Red Hat


--
Dave Nadler, USA East Coast voice (978) 263-0097,drn@nadler.com, Skype
  Dave.Nadler1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]