I read through understanding the __libc_init_array, but I have a question about C global variable initialization: Does __libc_init_array also copy plain C global initialized variables, if their VMA and LMA is different? Say, I have such an global array:
int myarray[] = {1, 2, 3, 4, 5, 6};
And my link script is like this:
sections
{
...
.data : {
*(.data)
} >RAM AT>FLASH
...
}
Will __libc_init_array copy the initialization data from FLASH to RAM for myarray on startup?
I tried it in a simple hello world program, but it looked like the data were not copied. But it could be my link script problem.