This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
libgloss/v850/crt0.S missing copy of .data from ROM to RAM?
- From: Josef Larsson <josef dot larsson at niradynamics dot se>
- To: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Tue, 24 May 2016 11:48:45 +0000
- Subject: libgloss/v850/crt0.S missing copy of .data from ROM to RAM?
- Authentication-results: sourceware.org; auth=none
Hi,
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.
By manually doing the following before invoking the main()-function (as
suggested by the GNU ld manual) I got my C++ compiled code working:
char *src = rom_data_start;
char *dst = ram_data_start;
while (dst < ram_data_end)
{
*dst++ = *src++;
}
Of course the symbol names above had to be provided in the linker script.
Am I right in assuming that the code is missing in crt or should it not
even be there (where else?)?
Sincerely,
Josef Larsson
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