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: Nick Clifton <nickc at redhat dot com>
- To: Josef Larsson <josef dot larsson at niradynamics dot se>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Tue, 24 May 2016 16:59:02 +0100
- 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>
Hi Josef,
> I have built GCC 4.9.2 together with newlib-2.2.0-1, which I then used
> for a v850 project. I experienced problems with the resulting binary I
> tried to flash. After some digging around I could not find any code
> copying the .data section from ROM to RAM, but I did find code in crt0.S
> clearing .bss.
> Am I right in assuming that the code is missing in crt
Yes.
> or should it not even be there (where else?)?
No, crt0 is the right place for this code.
Obviously this problem has arisen because no-one thought about the
possibility that the data sections might be loaded at a different
address from the their runtime locations. It should be fairly
straightforward to extend the assembler in crt0.S to support this
requirement however. Would you like to submit a patch ?
Presumably there may also be a need to copy the .zdata, .tdata and
.sdata sections. I also see that there is a .data1 section, although
I do not know if it is ever used.
Cheers
Nick