putting a variable in an own section
Torsten Mohr
tmohr@s.netic.de
Fri Apr 25 20:40:00 GMT 2003
Hi,
if (in C) i have a variable:
int a;
Then it is put in section .bss, which is cleared by the
C startup code.
If i have a variable WITH initial value:
int a = 0xdeadbeef;
Then i can see that this variable is located in section
.data (which is in RAM for (has Flag "W"). Also, if
i copy that section out:
v850-unknown-elf-objcopy -O binary -j .data qwe.elf data.bin
hexdump data.bin
0000000 beef dead
0000004
If i generate an S-Record, the initial value is placed into RAM:
S309FFFFB000EFBEADDE10
But i can NOT burn this S-Rec into the target, i can't flash a
RAM value. Shouldn't there be TWO sections, one in ROM with the
initial values, which is copied into a section in RAM?
Best regards,
Torsten.
More information about the Binutils
mailing list