[Arm] Remaining difference in crt0 code

Richard Earnshaw (lists) Richard.Earnshaw@arm.com
Mon Apr 15 09:14:00 GMT 2019

On 12/04/2019 21:42, Alexander Fedotov wrote:
> Hello Richard
> There is still some difference in crt0.S code in libgloss and libc
> respectively. Could you help me figure out what version is correct so
> we can get rid of this.

I don't think we can clean this up file at a time.  Trying to do so will
likely create inconsistencies in the sources as some files will be
patched and others not.

"git blame" and "git show" will be your friends here... For example,
taking the first hunk:

> Differences are following:
> --- newlib/libc/sys/arm/crt0.S    2019-04-12 23:28:32.237488800 +0300
> +++ libgloss/arm/crt0.S    2019-04-12 23:28:32.237488800 +0300
> @@ -79,6 +79,19 @@
>      .fnstart
>  #endif
> +    /* __ARM_ARCH_PROFILE is defined from GCC 4.8 onwards, however
> +    has been defined since 4.2 onwards, which is when v7-a support was added
> +    and hence 'A' profile support was added in the compiler.  Allow for this
> +    file to be built with older compilers.  We only call this for A profile
> +    cores.  */
> +#if defined (__ARM_ARCH_7A__) || (__ARM_ARCH_PROFILE == 'A')
> +/*  The init hook does not use the stack and is called before the
> stack has been set up.  */
> +    bl    _rdimon_hw_init_hook
> +    .weak    FUNCTION (_rdimon_hw_init_hook)
> +#endif
> +#endif
> +

"git blame" shows that this hunk is derived from two commits 99be2bc4ff
and then shortly afterwards 639951dda7.  "git show" can then be used to
view these individual patches and you can also use the date information
to identify the post to the newlib mailing list, which may contain
additional information about the patch.

Unwinding all of this is going to be a bit tedious, I fear, so I really
appreciate any assistance you can give.


More information about the Newlib mailing list