Summary
An object file is a computer file containing object code, that is, machine code output of an assembler or compiler. The object code is usually relocatable, and not usually directly executable. There are various formats for object files, and the same machine code can be packaged in different object file formats. An object file may also work like a shared library. In addition to the object code itself, object files may contain metadata used for linking or debugging, including: information to resolve symbolic cross-references between different modules, relocation information, stack unwinding information, comments, program symbols, debugging or profiling information. Other metadata may include the date and time of compilation, the compiler name and version, and other identifying information. The term "object program" dates from at least the 1950s: A term in automatic programming for the machine language program produced by the machine by translating a source program written by the programmer in a language similar to algebraic notation. A computer programmer generates object code with a compiler or assembler. For example, under Linux, the GNU Compiler Collection compiler will generate files with a .o extension which use the ELF format. Compilation on Windows generates files with a .obj extension which use the COFF format. A linker is then used to combine the object code into one executable program or library pulling in precompiled system libraries as needed. There are many different object file formats; originally each type of computer had its own unique format, but with the advent of Unix and other portable operating systems, some formats, such as ELF and COFF, have been defined and used on different kinds of systems. It is possible for the same format to be used both as linker input and output, and thus as the library and executable file format. Some formats can contain machine code for different processors, with the correct one chosen by the operating system when the program is loaded.
About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.