How to create object from binary?
Michael Schwingen
rincewind@discworld.dascon.de
Mon May 28 14:10:00 GMT 2001
Hello,
I am having a little problem and I can't believe I am the first one:
I have a binary file (say some compressed image data) which I want to link
into a program. I need a symbol before/after the binary data so that I can
reference it in my code - so I need something like
__image_start = .;
.image :
{
image.elf(.image1)
}
__image_end = .;
Now the problem is how to create the elf file from an existing binary.
Currently, I use
$(OBJCOPY) -I binary -O elf32-powerpc image image.elf
However, this places the image data in the .data section, which I can not
change - this leads to problems because I can't put it in the memory section
where it needs to be (in flash, not in RAM like the .data sections from my
code).
Is there an easy solution which I overlooked?
I want to avoid to generate hexdump-like output and pass these through the
assembler. I know that I could write some tool using the BFD library, but a
solution that works with an existing binutils installation would be
preferred.
cu
Michael
--
In the beginning there was nothing, which exploded.
More information about the Binutils
mailing list