This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
putting a variable in an own section
- From: Torsten Mohr <tmohr at s dot netic dot de>
- To: binutils <binutils at sources dot redhat dot com>
- Date: Fri, 25 Apr 2003 22:34:00 +0200
- Subject: putting a variable in an own section
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.