I've just encountered a problem when creating a binary from .elf. This
is with YAGARTO toolchain dated 20080928.
Normally the compiler produces an .elf file about 3,900KB in size, and
from that arm-elf-objcopy creates a .hex of 900KB and a .bin of 320KB.
However, when I use the section attribute to place a variable in a
specific section of memory, the binary file created is 2,094,081 KB!
Has anyone seen this? Perhaps there is a problem with my linker script?
My linker defines the memory areas like this:
1 | MEMORY
|
2 | {
|
3 | flash (rx) : ORIGIN = 0x00000000, LENGTH = 512K
|
4 | ram (rw) : ORIGIN = 0x40000040, LENGTH = 29888
|
5 | ramstack (rw) : ORIGIN = 0x40007500, LENGTH = 2816
|
6 | usbram : ORIGIN = 0x7FD00000, LENGTH = 8K
|
7 | ethram : ORIGIN = 0x7FE00000, LENGTH = 16K
|
8 | }
|
And then later in the section section I have:
1 | usbram : { *(.usbram) } > usbram
|
Then in the program code I declare a variable like this:
1 | int jmd __attribute__ ((section ("usbram"))) = 0;
|
The fact that this doesn't affect the .elf or .hex output leads me to
believe this is a bug with the binary output of arm-elf-objcopy.
Any tips?