julien MELCHIOR

Include a binary file into a section

Discussion created by julien MELCHIOR on Sep 13, 2010
Latest reply on Sep 28, 2010 by Carl Palmgren

Hello all,

 

I'm trying to include a binary file into the data section of my program using the INCLUDE directive in my linker script.

Everything seems ok except that the linker seems to treat the binary file as a text file.

 

My linker script looks like this:

 

blabla...

 

_RAMDISK_START = .;

INCLUDE ramdisk.img;

_RAMDISK_END=.;

 

blabla...

 

When i look in the linker map file, i can see that the difference between _RAMDISK_END and RAMDISK_START is correctly set to the size of my binary file but in the elf file, all the bytes are set to 0 (except the first ones which are text).

 

I'm using Codewarrior 10 (Eclipse). When i use CodeWarrior 7.2, everything is ok.

 

Can someone help me please?

 

Thank you.

Outcomes