Object file formats

We have seen that a program consists of several different memory areas and it has a startup function (not main, but something similiar). The operating system needs to understand these things, that's why object file formats where invented. Those formats describe exactly the structure of a program and how it is started. The operating system will read the program file and perform the necessary steps to run the program.

Use objdump -x myProgram.exe to get a feeling for the information contained in object files.

A look at /usr/include/elf.h shows you the structures of an object file in ELF format. Compiler tools etc. need to know these structures.