How to convert a memory dump/raw binary image into an ELF file
A.W.C. via binutils
binutils@sourceware.org
Sun Aug 5 20:26:00 GMT 2018
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
>
>
More information about the Binutils
mailing list