Aeroflex Gaisler AB
spacer spacer
spacer
How do I put the content of a file "as is" into the .data section (or somewhere else into memory)?
You can add a binary file to an existing elf file with objcopy, by adding a new section and fill it with the desired content:

sparc-elf-objcopy --add-section .myelfsection=file.bin --change-section-address .myelfsection=0x00001000

--set-section-flags .myelfsection=alloc,contents,load,data file.exe




The example above adds the file 'file.bin' to the elf file 'file.exe' at address 0x1000. Note that this is done after linking.
spacer

spacer
spacer spacer spacer spacer spacer spacer
Copyright 2008 Aeroflex Gaisler AB.