Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

4.1.6.14. nios2-elf-objcopy

Use this command to copy from one binary object format to another, optionally changing the binary data in the process.

Though typical usage converts from or to ELF files, the objcopy command is not restricted to conversions from or to ELF files. You can use this command to convert from, and to, any of the formats listed in the table below.

Table 16.  -objcopy Binary Formats
Command (...-objcopy) Comments
elf32-littlenios2, elf32-little Header little endian, data little endian, the default and most commonly used format
elf32-bignios2, elf32-big Header big endian, data big endian
srec S-Record (SREC) output format
symbolsrec SREC format with all symbols listed in the file header, preceding the SREC data
tekhex Tektronix hexadecimal (TekHex) format
binary Raw binary format Useful for creating binary images for storage in flash on your embedded system
ihex Intel hexadecimal (ihex) format

You can obtain information about the TekHex, ihex, and other text-based binary representation file formats online. As of the initial publication of this handbook, you can refer to the sbprojects.com knowledge-base entry on file formats.