Discussion:
Is it possible to convert *.out file to *.srec file?
Qiang Huang
2002-10-25 08:58:28 UTC
Permalink
If I build the ecos application to *.out file, is there any way I can
convert it to *.srec file format?
Thanks a lot
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
Andy Simpkins
2002-10-25 10:21:10 UTC
Permalink
use objcopy

i.e. on the platform I use...
arm-elf-objcopy -O srec foo.out foo.srec

Andy

-----Original Message-----
From: ecos-discuss-***@sources.redhat.com
[mailto:ecos-discuss-***@sources.redhat.com]On Behalf Of Qiang Huang
Sent: 25 October 2002 09:58
To: Ecos-Discuss
Subject: [ECOS] Is it possible to convert *.out file to *.srec file?


If I build the ecos application to *.out file, is there any way I can
convert it to *.srec file format?
Thanks a lot
--
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
Qiang Huang
2002-10-25 11:16:23 UTC
Permalink
how can I find out which target is support in my platform? what is *.out
file format stand for?
Thanks a lot

-----Original Message-----
From: Andy Simpkins [mailto:***@mindsail.com]
Sent: 25 October 2002 11:21
To: Qiang Huang; Ecos-Discuss
Subject: RE: [ECOS] Is it possible to convert *.out file to *.srec file?


use objcopy

i.e. on the platform I use...
arm-elf-objcopy -O srec foo.out foo.srec

Andy

-----Original Message-----
From: ecos-discuss-***@sources.redhat.com
[mailto:ecos-discuss-***@sources.redhat.com]On Behalf Of Qiang Huang
Sent: 25 October 2002 09:58
To: Ecos-Discuss
Subject: [ECOS] Is it possible to convert *.out file to *.srec file?


If I build the ecos application to *.out file, is there any way I can
convert it to *.srec file format?
Thanks a lot



--
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
Jonathan Larmour
2002-10-25 12:57:38 UTC
Permalink
Post by Qiang Huang
how can I find out which target is support in my platform?
I'm not sure exactly what you mean, but we always generate ELF and go
*from* there to other formats like binary, srec, etc.

As for what your platform requires, that's your problem - look at your own
board documentation!
Post by Qiang Huang
what is *.out
file format stand for?
out means it's the output. Nothing more.

Jifl
--
eCosCentric http://www.eCosCentric.com/ <***@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
Qiang Huang
2002-10-25 13:05:52 UTC
Permalink
like in the example:

gcc -g -IBASE_DIR/ecos-work/install/include hello.c -LBASE_DIR/
ecos-work/install/lib -Ttarget.ld -nostdlib

which format will be the output?( I got a.out file here. is this ELF
format?)

Thanks a lot.

-----Original Message-----
From: Jonathan Larmour [mailto:***@eCosCentric.com]
Sent: 25 October 2002 13:58
To: Qiang Huang
Cc: Ecos-Discuss
Subject: Re: [ECOS] Is it possible to convert *.out file to *.srec file?
Post by Qiang Huang
how can I find out which target is support in my platform?
I'm not sure exactly
what you mean, but we always generate ELF and go
*from* there to other formats like binary, srec, etc.

As for what your platform requires, that's your problem - look at your own
board documentation!
Post by Qiang Huang
what is *.out
file format stand for?
out means it's the output. Nothing more.

Jifl
--
eCosCentric http://www.eCosCentric.com/ <***@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
Jonathan Larmour
2002-10-25 13:09:17 UTC
Permalink
Post by Qiang Huang
gcc -g -IBASE_DIR/ecos-work/install/include hello.c -LBASE_DIR/
ecos-work/install/lib -Ttarget.ld -nostdlib
which format will be the output?( I got a.out file here. is this ELF
format?)
Yes. You could specify -o foo on the command line and it would create the
file as "foo" instead of a.out. Or you could call it foo.exe, or foo.dll,
or foo.txt for all it matters. The file will still be in ELF format!

The name a.out as a default is just a long-standing UNIX tradition. It's
not to be confused with "a.out format" which is different from ELF.

Jifl
--
eCosCentric http://www.eCosCentric.com/ <***@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
Grant Edwards
2002-10-25 14:10:15 UTC
Permalink
Post by Jonathan Larmour
Yes. You could specify -o foo on the command line and it would create the
file as "foo" instead of a.out.
Except under Cygwin, where specifying "-o foo" creates foo.exe.
IMO, this is a bug in the linker. [The end result is that the
makefiles I use under Linux don't work under Cygwin.]
--
Grant Edwards
***@visi.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
Jonathan Larmour
2002-10-25 14:11:55 UTC
Permalink
Post by Grant Edwards
Post by Jonathan Larmour
Yes. You could specify -o foo on the command line and it would create the
file as "foo" instead of a.out.
Except under Cygwin, where specifying "-o foo" creates foo.exe.
IMO, this is a bug in the linker. [The end result is that the
makefiles I use under Linux don't work under Cygwin.]
I think they "fixed" that now in more recent GCC when cross compiling.

Jifl
--
eCosCentric http://www.eCosCentric.com/ <***@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
Grant Edwards
2002-10-25 14:18:40 UTC
Permalink
Post by Jonathan Larmour
Post by Grant Edwards
Post by Jonathan Larmour
Yes. You could specify -o foo on the command line and it would create the
file as "foo" instead of a.out.
Except under Cygwin, where specifying "-o foo" creates foo.exe.
IMO, this is a bug in the linker. [The end result is that the
makefiles I use under Linux don't work under Cygwin.]
I think they "fixed" that now in more recent GCC when cross compiling.
Could be (IIRC, I ran into the problem with ld rather than
gcc).

I hear that GCC 3.x now ignores carriage returns in source
files in a useful manner. That was a long time coming and
could have save me hours of time spent troubleshooting cutomer
problems over the phone. :)
--
Grant Edwards
***@visi.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
Gary Thomas
2002-10-25 13:10:50 UTC
Permalink
Post by Qiang Huang
gcc -g -IBASE_DIR/ecos-work/install/include hello.c -LBASE_DIR/
ecos-work/install/lib -Ttarget.ld -nostdlib
which format will be the output?( I got a.out file here. is this ELF
format?)
Most likely. Again, check your documentation for the details, but
you can use the "file" command like this, just to verify:
[***@hermes ecos]$ file test/timer
test/timer: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV),
statically linked, not stripped
Post by Qiang Huang
Thanks a lot.
-----Original Message-----
Sent: 25 October 2002 13:58
To: Qiang Huang
Cc: Ecos-Discuss
Subject: Re: [ECOS] Is it possible to convert *.out file to *.srec file?
Post by Qiang Huang
how can I find out which target is support in my platform?
I'm not sure exactly
what you mean, but we always generate ELF and go
*from* there to other formats like binary, srec, etc.
As for what your platform requires, that's your problem - look at your own
board documentation!
Post by Qiang Huang
what is *.out
file format stand for?
out means it's the output. Nothing more.
Jifl
--
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
--
------------------------------------------------------------
Gary Thomas |
eCosCentric, Ltd. |
+1 (970) 229-1963 | eCos & RedBoot experts
***@ecoscentric.com |
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
Grant Edwards
2002-10-25 14:08:37 UTC
Permalink
Post by Qiang Huang
gcc -g -IBASE_DIR/ecos-work/install/include hello.c -LBASE_DIR/
ecos-work/install/lib -Ttarget.ld -nostdlib
which format will be the output?( I got a.out file here. is this ELF
format?)
$ man file
--
Grant Edwards
***@visi.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
Qiang Huang
2002-10-25 14:59:27 UTC
Permalink
what 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-----
From: Nick Garnett [mailto:***@ecoscentric.com]
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 Huang
If 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
Andrew Lunn
2002-10-25 15:20:37 UTC
Permalink
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 Huang
what 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 Huang
If 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
Cusson, Pascal
2002-10-25 15:26:40 UTC
Permalink
Hi Qiang,
As stated before there are many free tools to convert an elf (format
produced by default) to S-Record. The problem with S-Record is that they
don't contain the debug information. I would really doubt that ecos
won't work with S-record however you will not be available to use a
debugger.

Pascal

-----Original Message-----
From: Qiang Huang [mailto:***@liverpool.ac.uk]
Sent: Friday, October 25, 2002 10:59 AM
To: Nick Garnett
Cc: Ecos-Discuss
Subject: RE: [ECOS] Is it possible to convert *.out file to *.srec file?


what 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-----
From: Nick Garnett [mailto:***@ecoscentric.com]
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 Huang
If 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
Loading...