This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to convert a memory dump/raw binary image into an ELF file
- From: "A.W.C. via binutils" <binutils at sourceware dot org>
- To: <binutils at sourceware dot org>
- Date: Sun, 5 Aug 2018 20:26:52 +0000 (UTC)
- Subject: Re: How to convert a memory dump/raw binary image into an ELF file
- References: <396900233.2367152.1533500812249.ref@mail.yahoo.com>
- Reply-to: "A.W.C." <bluestream at ymail dot com>
- Reply-to: "A.W.C." <bluestream at ymail dot com>
Is it available pre-compiled rtems-bin2c binary for Windows? or .deb package for Linux?
What command syntax should I use in my particular case? (arguments)
bin2c [-c] [-z] <input_file> <output_file>
Regards,
Alex
--------------------------------------------
On Sun, 8/5/18, Joel Sherrill <joel@rtems.org> wrote:
Subject: Re: How to convert a memory dump/raw binary image into an ELF file
To: "A.W.C." <bluestream@ymail.com>
Cc: binutils@sourceware.org
Date: Sunday, August 5, 2018, 9:52 PM
On Sun, Aug 5, 2018, 1:45 PM
A.W.C. via binutils <binutils@sourceware.org>
wrote:
>
How to convert a raw MIPS binary file into an .ELF file?
> The binary file is contents of memory
region (SPI Flash), converted from
> hex
to binary form (.bin) use xxd -r command.
> The Linux 'file' command
determines the file type of file.bin as 'data'
> file type.
>
This can be done with objcopy
but over the years on the RTEMS project we
found it sometimes painful to get CPU model and
endian flags set correctly
that way.
We have a utility called
rtems-bin2c that converts a binary file into a C
array. Then you can compile that as you would
any other file in the
project. Reliable
cross-architecture solution.
It is in rtems-tools at git.rtems.org.
--joel
>
>
>
>
>
> Regards,
> Alex
>
>