This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Elf to Bin format
- To: "'ecos-discuss at sources dot redhat dot com'" <ecos-discuss at sources dot redhat dot com>
- Subject: [ECOS] Elf to Bin format
- From: "Narayana, Venkat A." <NarayVA at nsc-msg01 dot network dot com>
- Date: Fri, 1 Jun 2001 11:18:18 -0500
- Cc: "Narayana, Venkat A." <NarayVA at nsc-msg01 dot network dot com>
Hi,
When i convert my redboot.elf file to redboot.bin file,
the .data section is not getting into bin file.How do i know this?
Because,after i flashed the bin file, i used the tool(from windriver)
to see the contents of flash memory and i found that the code got into
it till the start of the data section or till the end of the rodata section.
After some digging i found that the bin file size corresponds to the
end of rodata section or to the start of data section.
The following are various section starts and ends:
_stext = 2000H
_etext = 294b4H
rom_data_start = 302ecH -> Till here the code is in Bin file and
corresponds to the size of bin file.
ram_data_start = a000a000H
ram_data_end = a000a7d4H
The following are my Program Headers:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x008000 0xa0000000 0x00000000 0x00040 0x00040 RWE 0x8000
LOAD 0x00a000 0x00002000 0x00002000 0x2e2ec 0x2e2ec RWE 0x8000
LOAD 0x03a000 0xa000a000 0x000302ec 0x007d4 0x007d4 RW 0x8000
LOAD 0x040180 0xa1f00180 0xa1f00180 0x00000 0x06c2c RW 0x8000
Looking at Program Headers and then what is in bin file( using windrivers
visionclick tool), i figured that, whenever my Load address( in target.ld
script)
is diffrent from my relocation address, then, that section is ignored by
objcopy, while it is converting from elf format to bin format.
I tried tha 'add-section' option of objcopy, but that didn't work.
Where could be the problem? Is my understanding of the stuff correct or am i
becoming Sherlock-homeless;-)
I would really appreciate your help on this.Btw, i read somewhere that when
we convert ELF file to another format we loose some data, is that what's
happeing here? How to overcome this. Because without .data section, i cannot
get ahead.
Regards
Venkat N