Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

converting elf to binary

802 views
Skip to first unread message

jjay...@gmail.com

unread,
May 23, 2008, 2:39:43 PM5/23/08
to
Hi,
I am running into problems trying to convert an existing elf format
vxworks.st to a compressed binary image. I am using PPC(Artesyn),
Vxworks 5.5 and PPCBoot. Here is what I am doing:

objcopyppc -O binary vxWorks.st vxWorks.bin
gzip -9 vxWorks.bin
mkimage -A ppc -C gzip -O VxWorks -n "VxWorks" -a 0x800000 -e 0x800000
-d vxWorks.bin.gz vxWorks.img

The PPCBoot displays the right header info, CRC check is fine and
uncompresses it fine. But it hangs when trying to boot the
uncompressed image:

## Booting image at 00400000 ...
Image Name: VxWorks
Image Type: PowerPC VxWorks Kernel Image (gzip compressed)
Data Size: 517225 Bytes = 505 kB = 0 MB
Load Address: 00800000
Entry Point: 00800000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## Ethernet MAC address not copied to NV RAM
## No elf image at address 0x00800000
## Not an ELF image, assuming binary
## Using bootline (@ 0x4200): ip=auto
## Starting vxWorks at 0x00800000 ...

I have tried elfToBin instead of objcopyppc and it doesnt work either.
I am wondering what I am missing here.

Thanks for your help!

Jay

sybe

unread,
May 26, 2008, 4:13:46 AM5/26/08
to

Dear Jay,

I had lot of problem with elf format for my bootrom. Windriver's
support team advise me to avoid this format. Now I use hex format and
that works fine. Elf format is always generated (even if you indicate
hex or directly bin format). I use hex file for the flash programmer
and elf file for debug (it includes symbols).

I never user the command line only workbench and OCD (based on
eclipse) and I work with VxWorks 6.5.

I don't know if this message help you but it seems elf format has lot
of problem since a long time and some of them are solved but not all
of them.

regards,
Sylvain

karthikbalaguru

unread,
May 26, 2008, 5:45:43 AM5/26/08
to

Then, how to do the debugging ?

> Now I use hex format and
> that works fine. Elf format is always generated (even if you indicate
> hex or directly bin format). I use hex file for the flash programmer
> and elf file for debug (it includes symbols).
>
> I never user the command line only workbench and OCD (based on
> eclipse) and I work with VxWorks 6.5.
>
> I don't know if this message help you but it seems elf format has lot
> of problem since a long time and some of them are solved but not all
> of them.

Interesting :( :( . Is there any link for this info regarding the ELF
problem ?

Now, i wonder which could be the best format for debugging with JTAG.
Does ELF has lot of problems ?
What could be the alternative to ELF for debugging ?

Thx in advans,
Karthik Balaguru

karthikbalaguru

unread,
May 26, 2008, 10:59:24 AM5/26/08
to
On May 26, 1:13 pm, sybe <sylvain.benoit-...@areva-td.com> wrote:

Are you sure that ELF file format has problems ?
I find this to be a strange information about ELF file format.

I have used ELF formats in many other environments, i have not
faced any problems.

I am worried if ELF format has some problems, then it will
cause lot of unnecessary pain while debugging.

Is there any link in the internet that confirms the problems with
ELF file format ?
Are you sure that ELF file format has problems ?

sybe

unread,
May 27, 2008, 5:45:44 AM5/27/08
to
On May 26, 11:45 am, karthikbalaguru <karthikbalagur...@gmail.com>
wrote:
> Karthik Balaguru- Hide quoted text -
>
> - Show quoted text -

Dear Karthik Balaguru

I don't use elf file in order to flash my board (NOR or NAND) but I
use elf for debugging. In order to do that you must download symbols
(and symbols only) from elf file. When I connect my probe in OCD I've
a red arrow icon to "reset and download". In this properties form,
select "download" tab, add your elf file, uncheck "download" and CHECK
"load symbols". With this configuration I can debug my flashed code
(i.e: bootrom) with symbols taken in the elf file.

And I confirm I have some problem to flash something if I use elf file
as source (even if this case exists in the flash programmer).

regards,
Sylvain

jjay...@gmail.com

unread,
May 29, 2008, 10:54:53 AM5/29/08
to
I found out the problem. I was using incorrect entry point and load
address. Once I fixed it the kernel started booting up.

Thanks guys!

jjay...@gmail.com

unread,
May 29, 2008, 10:59:49 AM5/29/08
to
Karthik,
Sylvain is refering to bootrom (boot loader) issues. I have used elf
format for kernel images and never faced problems. We switched to
binary compressed format because you can put a CRC check in that. This
will detect any corrupted kernel received either over network or read
out from flash.

Are you looking to debug elf bootrom image?

Thanks,
Jay

karthikbalaguru

unread,
May 29, 2008, 2:13:12 PM5/29/08
to

Yes, Does vxworks support debugging using elf file
format ?
If there is some problem in debugging using elf file format
in VxWorks, can you pls let me know the alternative file
format that can be used for debugging ?

Jason

unread,
May 30, 2008, 11:46:03 AM5/30/08
to
On May 29, 11:13 am, karthikbalaguru <karthikbalagur...@gmail.com>
wrote:

Aside from any issues involving bootroms, you shouldn't have
any problems with ELF ... its a standard format, and I've
never had any problems with any of the tools generating
incorrect images.

ELF is basically a relocatable binary image, so there's a table
at the start saying where text, data, symbols are so they can
be relocated independently.

The debugger will access the symbol part of the ELF file;
the only other information it might need, it is wasn't involved
in loading vxWorks, is where the rest of the sections
where relocated too

By default, the VxWorks image (with no extension) is a ELF
file. Similarly, RTP's (.vxe) are ELF files.

If you download your VxWorks image over a network and
attach the target server to it, it will use the VxWorks image
to get the symbols.

One cool thing I've done with RTP's (presumably it would
work with the VxWorks image too) is to generate the RTP
with -g to get full symbol information embedded in the
ELF file). The RTP can get huge!!

We keep the original file, and the strip the symbols out,
and load that RTP - its a lot smaller that way, but we can
still use the original so the debugger has access to symbols

Jason

0 new messages