This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: binary to elf conversion
- From: Sergei Organov <osv at javad dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 16 Aug 2007 20:15:46 +0400
- Subject: Re: binary to elf conversion
- References: <46C46561.30105@oarcorp.com>
Joel Sherrill <joel.sherrill@oarcorp.com> writes:
> Hi,
>
> I think something broke for converting binary
> files to elf using objcopy. I know I did this before
> but can't seem to find a binutils that can do
> this now. I have tried both the RTEMS testing
> version (a pre 2.18 snapshot) and our
> stable repositories (something older)
> and neither is able to link with the object file produced by objcopy'ing
> a binary file to a .o.
>
> /opt/rtems-4.8/lib/gcc/powerpc-rtems4.8/4.2.1/../../../../powerpc-rtems4.8/bin/ld:
> unknown architecture of input file `o-optimize/tarfile.o' is
> incompatible with powerpc:common output
>
> Produced by this command:
>
> powerpc-rtems4.8-objcopy -I binary -O elf32-powerpc tarfile
> o-optimize/tarfile.o
>
> I tried mips and i386 and both fail with similar errors.
>
> Is this working for anyone else on any target?
This never worked for me. Instead I use assembler to create empty .o
file, then add binary section to it using objcopy:
$ echo | as -o file.o
$ objcopy --add-section=section_name=file.bip file.o
-- Sergei.