Thu Jun 16 18:27:05 CEST 2011
For Staapl it might be intersting to try to figure out how to convert
between binary and assembler using objdump.
arm-eabi-objdump -b binary -m arm -D foo
Here -D is used instead of -d, because apparently the raw binary data
is interpreted to be in .data segement.
Maybe it's simpler to convert bin to .o with all data in the .text
arm-eabi-objcopy -I binary -O elf32-littlearm -B arm --rename-section .data=.text foo foo.o
But that doesn't set the CODE attribute that are in ordinary binaries,
but the DATA attribute is set. Note that renaming happens after
arm-eabi-objcopy -I binary -O elf32-littlearm -B arm --rename-section .data=.text --set-section-flags .data=code foo foo.o
To make it less confusing it seems better to reorder the flags, though
that doesn't change functionality
-I binary -O elf32-littlearm -B arm \
--set-section-flags .data=code \
--rename-section .data=.text foo foo.o