This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

hex, elf, and exe files

What are .hex files, and .elf files? How are these related to an .exe file?

Thanks,
Jordon

Parents
  • These are all various file formats for describing programs. (Usually, that is; they could be used for other purposes, particularly the .hex file.)

    A .hex file (usually Intel HEX-386, these days) describes raw binary data in a format that comes in pieces, mostly so you can skip large ranges of all zeroes, and with a checksum so you can validate the data. These files are usually used by low-level tools such as flash programmers.

    An ELF file is a format for describing object code, typically output from a compiler ready to be fed into a linker. As such, the ELF format includes symbol tables for symbols that need to be linked, along with other debug information. ELF is particularly popular with Unix and tools descended from that environment, such as gcc.

    An .exe file is the DOS/Windows format for an "executable" program. These files are output from a linker and ready to be loaded by the OS. Loading an executable involves relocation of some offsets in the file to account for the actual address at which the OS chooses to load the file. The MS OSes are popular enough that some people have started to say "the exe file" for any executable for any OS, but of course that particular dot-3 extension has a specific file format.

    A typical development process would typically go something like:

    source -(compile)-> ELF -(link)-> hex

    hex -(flash programmer)-> target board

    Google will tell all the details of each of these file formats. The Keil site also has a .hex spec (at least). Your operating systems or compilers textbook will tell you all about the processes of linking and locating code to be ready for execution.

Reply
  • These are all various file formats for describing programs. (Usually, that is; they could be used for other purposes, particularly the .hex file.)

    A .hex file (usually Intel HEX-386, these days) describes raw binary data in a format that comes in pieces, mostly so you can skip large ranges of all zeroes, and with a checksum so you can validate the data. These files are usually used by low-level tools such as flash programmers.

    An ELF file is a format for describing object code, typically output from a compiler ready to be fed into a linker. As such, the ELF format includes symbol tables for symbols that need to be linked, along with other debug information. ELF is particularly popular with Unix and tools descended from that environment, such as gcc.

    An .exe file is the DOS/Windows format for an "executable" program. These files are output from a linker and ready to be loaded by the OS. Loading an executable involves relocation of some offsets in the file to account for the actual address at which the OS chooses to load the file. The MS OSes are popular enough that some people have started to say "the exe file" for any executable for any OS, but of course that particular dot-3 extension has a specific file format.

    A typical development process would typically go something like:

    source -(compile)-> ELF -(link)-> hex

    hex -(flash programmer)-> target board

    Google will tell all the details of each of these file formats. The Keil site also has a .hex spec (at least). Your operating systems or compilers textbook will tell you all about the processes of linking and locating code to be ready for execution.

Children