As per my understanding below command is loading value of "__image_copy_start" to r1 register.
ldr r1, =__image_copy_start
I am trying to understand how value is assigned to "__image_copy_start". I couldn't find any assignment statement which is assigning value to "__image_copy_start", but I could see following declarations in "arch/arc/lib/sections.c" file.
char __image_copy_start[0] __attribute__((section(".__image_copy_start")));
char __image_copy_end[0] __attribute__((section(".__image_copy_end")));
It seems __attribute__((section("")))
is used to place the variables in special sections(In the above statement "__image_copy_start[0]" will be placed at ".__image_copy_start" section). Can you help to understand the following.
- How value is assigned to "__image_copy_start[0]" ?
- Why "__image_copy_start" declared as array "char __image_copy_start[0]" why not "char __image_copy_start" ?