This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How to create object from binary?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]