Executable and linking format (ELF) files are commonly used object file formats in x86linux systems. There are three main types:
(1) a relocatable file suitable for connection. It can be used with other target files to create executable files and share the target files.
(2) executable file, used to provide Program Process image, the loaded memory is executed.
(3) shared object file (shared object file). The connector can connect it with other relocated files and shared target files to other target files, the dynamic connector can also combine it with executable files and other shared target files to create a process image.
The ELF file format is complex.
What is Intel hex format?
An Intel HEX file is an ASCII text file that records text lines. In an Intel HEX file, each row is a hex record, a machine code or data constant consisting of hexadecimal numbers, intel hex files are often used to transmit programs or data.
Stored in ROM and EPROM. Most programmers and simulators use intel hex files.
An Intel HEX file can contain any number of hexadecimal records. Each record has five fields. The following is a record format.
: Llaaaatt [DD...] CC
Each group of letters is an independent domain. Each letter is a hexadecimal number. Each domain consists of at least two hexadecimal numbers. The following is a description of the byte.
: Colon is the start of each intel hex record
Ll is the length field of the record, which indicates the number of bytes of data (dd.
Aaaa is the address field, which indicates the starting address of the data.
<If it is a data record, this indicates the offset address of the data in the record to be burned in the EPROM. For those that do not support extended segment addresses or extended linear addresses, such as 89C51, this is the starting address of the record>
TT indicates the type of the hex record. It may be the following types:
00 -- Data Record
01 -- end of File
02 -- extended segment address record
04 -- Extended Linear address records
Dd is a data field that represents one byte of data. A record may contain multiple data bytes, and the number of bytes is acceptable.
View description of LL domain
CC is the validation and domain, indicating the validation and, the calculation method is to record all the letter pairs starting with the colon <excluding the valid word and colon> As hexadecimal numbers <a pair of letters represents a hexadecimal number, such a hexadecimal number is a byte> all add up, and then divide the remainder obtained by MoD 256, and finally obtain the complement code of the remainder, that is, the valid byte CC.
Cc = 0x01 + not (0x03 + 0x00 + 0x00 + 0x00 + 0x02 + 0x00 + 0 x 5E) % 0 × 100) = 0 × 01 + 0 × 9C = 0 × 9d>
An Intel HEX file consists of several data records. A Data Record ends with a carriage return and a line feed. <enter 0 x 0d for behavior 0 x 0a>
For example, the following data record
10 is the number of bytes of data recorded in this row.
2462 is the starting address of the data in the memory <the EPROM address to be written>
00 is the record Type 00 (a data record)
464c to 464c is Data
33 is the validation and
The binfile is a direct binary file with no internal address mark. Generally, it starts from 00 when you use the programmer to burn and run the program. If you download and run the program, you can download it to the compile address.
Summary: The ELF file can be converted to the other two types of files, and the Hex file can be directly converted to the binfile, but the base address must be given to convert the BIN file to the Hex file. Hex and bin cannot be converted to elf files because elf has a large amount of information. In addition, there is an ADS debugging file axf, which can be converted to a binfile. Run the following command fromelf-nodebug xx. Axf-bin xx. Bin.
Arm-Linux-objcopy-I? View supported formats