public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Re: .elf to .bin (making an image)
@ 2000-09-26 16:58 Michael Sokolov
  2000-09-27 10:10 ` Shaun Jackman
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Sokolov @ 2000-09-26 16:58 UTC (permalink / raw)
  To: crossgcc, sjackman

Shaun Jackman <sjackman@ed.gray.internal> wrote:

> How do I create an image of an executable suitable for burning into flash?
> I have a .elf, so a file converter would do.

Use objcopy from binutils.

> Or, is
> there a way to get an ld script to link the .bin in with a symbol at the
> start of the dump?

You can list your .bin as an object on the link line (indicating the input
object format as binary) and use the linker script to direct it where you want
it to go.

--
Michael Sokolov		Harhan Engineering Laboratory
Public Service Agent	International Free Computing Task Force
			International Engineering and Science Task Force
			615 N GOOD LATIMER EXPY STE #4
			DALLAS TX 75204-5852 USA

Phone: +1-214-824-7693 (Harhan Eng Lab office)
E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP) (UUCP coming soon)

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: .elf to .bin (making an image)
  2000-09-26 16:58 .elf to .bin (making an image) Michael Sokolov
@ 2000-09-27 10:10 ` Shaun Jackman
  0 siblings, 0 replies; 4+ messages in thread
From: Shaun Jackman @ 2000-09-27 10:10 UTC (permalink / raw)
  To: crossgcc

> > How do I create an image of an executable suitable for burning into flash?
> > I have a .elf, so a file converter would do.
> Use objcopy from binutils.
Works perfect. thanks

> > Or, is there a way to get an ld script to link the .bin in with a
> > symbol at the start of the dump?
> You can list your .bin as an object on the link line (indicating the input
> object format as binary) and use the linker script to direct it where you want
> it to go.
I'm having trouble making this work.
My command line is...
arm-elf-gcc -nostartfiles -L../at91 -o main.elf main.o flash.o
 -bbinary image.bin -T./start.ld -larch

And the relevant section of the .ld script is...
  .rodata :
  {
    *(.rodata)
    *(.rodata.*)
    *(.gnu.linkonce.r*)
    image = .;
    *.bin(*)
    image_end = .;
  } > rom

I get this error...
main.o: file not recognized: File format not recognized
arm-elf-gcc: file path prefix
`/tools/H-i686-pc-linux-gnu/lib/gcc-lib/binary/2.95.2/' never used
make: *** [main.elf] Error 1

It looks like it's trying to interpret my .o files as binarires (when they
should be elf object files, I think). How do I link the .o files as
object files and the .bin file as a binary?

Thanks,
Shaun



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: .elf to .bin (making an image)
@ 2000-09-27 21:31 Michael Sokolov
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Sokolov @ 2000-09-27 21:31 UTC (permalink / raw)
  To: crossgcc

Shaun Jackman <sjackman@ed.gray.internal> wrote:

> I'm having trouble making this work.
> My command line is...
> arm-elf-gcc -nostartfiles -L../at91 -o main.elf main.o flash.o
>  -bbinary image.bin -T./start.ld -larch
>
> [...]
>
> I get this error...
> main.o: file not recognized: File format not recognized
>
> [...]
>
> It looks like it's trying to interpret my .o files as binarires (when they
> should be elf object files, I think). How do I link the .o files as
> object files and the .bin file as a binary?

Try -belf32-arm (or whatever is the correct BFD target for ARM ELF, I'm not
sure) before main.o and see if it works better.

--
Michael Sokolov		Harhan Engineering Laboratory
Public Service Agent	International Free Computing Task Force
			International Engineering and Science Task Force
			615 N GOOD LATIMER EXPY STE #4
			DALLAS TX 75204-5852 USA

Phone: +1-214-824-7693 (Harhan Eng Lab office)
E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP) (UUCP coming soon)

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* .elf to .bin (making an image)
@ 2000-09-26 15:28 Shaun Jackman
  0 siblings, 0 replies; 4+ messages in thread
From: Shaun Jackman @ 2000-09-26 15:28 UTC (permalink / raw)
  To: crossgcc

How do I create an image of an executable suitable for burning into flash?
I have a .elf, so a file converter would do. Or, alternatively how do I
get ld to create both output formats?

Second question... How do I include this binary dump into the rodata
segment of a different app? Convert the .bin to .h and include it in the
second app? (I think I remember seeing a util that would do this) Or, is
there a way to get an ld script to link the .bin in with a symbol at the
start of the dump? The second app will be burning flashes with this
binary.

Thanks,
Shaun



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-09-27 21:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-26 16:58 .elf to .bin (making an image) Michael Sokolov
2000-09-27 10:10 ` Shaun Jackman
  -- strict thread matches above, loose matches on Subject: below --
2000-09-27 21:31 Michael Sokolov
2000-09-26 15:28 Shaun Jackman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).