You have to be careful not to mix up two things here.
There are file names and there are object file formats.
elf is an object file format. So if Coff and aout. These specify how
you represent machine code, symbol tables, data etc in an object file
or an executable. For eCos elf format is used.
Then there are file names. For a unix system, you can name your
program anything you want. For M$ system, the ending has some
importance. eg .com and .exe or .bat till the OS how to execute the
file. Now, when you ask gcc to link an image, and you don't pass the
-o option to give is a name, it defaults to a.out. This is purely
historic. The name it uses has nothing to do with the file format.
Now, you can turn any object file formats i listed above to .srec. All
this does is strip away all the information that is not needed, like
the symbol table, the debug information etc. It leaves behind the raw
image you need to put into memory and execute. It then takes this raw
image and turns it into an ASCII format which many bootloaders and
flash programmers understand. This ASCII format is called srec.
This should answer the second part of the question.
For the first part, the linker scripts are setup for elf. You could in
theory re-write them for another format. There could be other things
which require elf, like the magic sections redboot uses for its
commands, and the HAL tables. I don't know enough about gcc to so...
I think, a long time ago, someone asked about using a different object
file format. They had a special tool chain from a manufacture which
did not support elf. I don't remember the outcome of the discussion,
but its probably in the archive....
HTH
Andrew
Post by Qiang Huangwhat do u mean ecos relies on the features of the ELF format to work
correctly? Does that mean I can't convert the ELF format to *.srec format
and use?
Thanks
-----Original Message-----
Sent: 25 October 2002 11:53
To: Qiang Huang
Cc: Ecos-Discuss
Subject: Re: [ECOS] Is it possible to convert *.out file to *.srec file?
Post by Qiang HuangIf I build the ecos application to *.out file, is there any way I can
convert it to *.srec file format?
Thanks a lot
You should not be using tools that produce a.out format object
files. eCos relies on features of the ELF format to work correctly.
If your tools are producing a.out files then they are the wrong
ones. Look at the documentation on the website for how to build the
correct ones.
--
Nick Garnett - eCos Kernel Architect
http://www.eCosCentric.com/
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss