Binary format conversion

Despite containing all the compiled symbols in binary format, an ELF file is prefixed with a header that contains a description of the content, and pointers to the position where the sections start within the file. All this extra information is not needed to run on an embedded target, so the ELF file produced by the linker has to be transformed into a plain binary file. A tool in the toolchain, called objcopy, converts images from one standard format to others, and what is generally done is a conversion of the ELF into a raw binary image, without altering the symbols. To transform the image from ELF to binary format, invoke:

$ arm-none-eabi-objcopy -I elf -O binary image.elf image.bin

This creates a new file, called ...

Get Embedded Systems Architecture now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.