binary to elf conversion
Segher Boessenkool
segher@kernel.crashing.org
Wed Aug 22 01:29:00 GMT 2007
> So objcopy from binary to linkable file isn't really the best
> or most reliable way.
>
> Sounds like I need to change the procedure on my side
> to generate a .s file which defines the same symbolic
> information around an incbin as objcopy did and then
> assemble it with the same flags as the rest of the application.
> Right?
>
> Or would I be better off to write a program to dump the
> binary file as a C file with an initialized array?
You can use one of the many available "bin2c" style programs
for this; binutils contains one (used during SPU support builds),
the kernel contains one.
Or you can just use a linker script, if you have one target
only.
> I am looking for something cross-target and reliable.
I'd go for bin2c then.
Segher
More information about the Binutils
mailing list