This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: libgloss/v850/crt0.S missing copy of .data from ROM to RAM?
- From: Josef Larsson <josef dot larsson at niradynamics dot se>
- To: Nick Clifton <nickc at redhat dot com>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Thu, 26 May 2016 11:16:27 +0000
- Subject: Re: libgloss/v850/crt0.S missing copy of .data from ROM to RAM?
- Authentication-results: sourceware.org; auth=none
- References: <57443F9D dot 7060609 at niradynamics dot se> <89c44b3c-3cf8-5477-e354-47b02b6be6b9 at redhat dot com> <5745D20E dot 8040400 at niradynamics dot se> <002d6eff-f9ba-98d6-3202-ba520900ba84 at redhat dot com>
Hi Nick,
Looks perfect! Should save the next person some debugging time :).
Sincerely,
Josef Larsson
Den 2016-05-26 kl. 12:58, skrev Nick Clifton:
> Hi Josef,
>
>> Since the V850 architecture is quite
>> special, perhaps a comment or two in the source code would suffice,
>> notifying the user that the copying from ROM to RAM has to be done manually?
> Something like the patch below ?
>
> I will check it in shortly.
>
> Cheers
> Nick
>
> diff --git a/libgloss/v850/crt0.S b/libgloss/v850/crt0.S
> index c9c93e7..8d44f88 100644
> --- a/libgloss/v850/crt0.S
> +++ b/libgloss/v850/crt0.S
> @@ -24,6 +24,12 @@ _start:
> movhi 2, r0, r6
> ldsr r6, fpsr
> #endif
> + // FIXME: We currently assume that the data sections
> + // are loaded in place - ie that they do not need to
> + // moved from eg ROM into RAM. If that is not true
> + // then extra code needs to be added here.
> +
> + // Initialise the .bss section.
> mov hilo(_edata), r6
> mov hilo(_end), r7
> .L0:
> @@ -52,6 +58,9 @@ _start:
> movhi hi(__gp), r0, gp
> movea lo(__gp), gp, gp
>
> + // FIXME: See note about not moving the data sections above.
> +
> + // Initialise the .bss section.
> movhi hi(_edata), r0, r6
> movea lo(_edata), r6, r6
> movhi hi(_end), r0, r7
>
Josef Larsson
Systems Engineer
NIRA Dynamics AB
Wallenbergs gata 4
58330 LinkÃping
Phone: +46 13 491 98 11
Mobile: +46 767 860 739
www.niradynamics.se - Together for smarter safety