In computer science, object code, or an object file, is the representation of code that a compiler or assembler generates by processing a source code file. Computer science (or computing science) is the study and the Science of the theoretical foundations of Information and Computation and their A compiler is a Computer program (or set of programs that translates text written in a computer language (the source language) into another In Computer science, source code (commonly just source or code) is any sequence of statements or declarations written in some Human-readable Object files contain compact code, often called "binaries". A linker is typically used to generate an executable or library by linking object files together. In Computing, an executable (file causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a file that only contains In Computer science, a library is a collection of Subroutines used to develop Software. The only essential element in an object file is machine code (code directly executed by a computer's CPU). Machine code or machine language is a system of instructions and data executed directly by a Computer 's Central processing unit. Object files for embedded systems might contain nothing but machine code. An embedded system is a special-purpose Computer system designed to perform one or a few dedicated functions often with Real-time computing constraints However, object files often also contain data for use by the code at runtime, relocation information, program symbols (names of variables and functions) for linking and/or debugging purposes, and other debugging information. In Computer science, relocation is the process of replacing symbolic references or names of libraries with actual usable addresses in memory before running Debug symbols is the information on what Assembler or high-level programming language constructions generated specific piece of Machine code in the given
Contents |
An object file format is a computer file format used for the storage of object code and related data typically produced by a compiler or assembler. A computer is a Machine that manipulates data according to a list of instructions. A file format is a particular way to encode information for storage in a Computer file. A compiler is a Computer program (or set of programs that translates text written in a computer language (the source language) into another See the terminology section below for information regarding inconsistent use of the terms assembly and assembler
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 COFF and ELF, have been defined and used on different kinds of systems. Unix (officially trademarked as UNIX, sometimes also written as Unix with Small caps) is a computer See also Software portability In Computer science, porting is the process of adapting software so that an executable program can be created The Common Object File Format ( COFF) is a specification of a format for Executable, Object code, and shared library Computer In Computing, the Executable and Linking Format ( ELF, formerly called Extensible Linking Format) is a common standard File format for Executables It is common for the same file format to be used both as linker input and output, and thus as the library and executable file format.
The design and/or choice of an object file format is a key part of overall system design. It affects the performance of the linker and thus programmer turnaround while developing. A programmer is someone who writes Computer software. The term computer programmer can refer to a specialist in one area of computer programming or to a generalist If the format is used for executables, the design also affects the time programs take to begin running, and thus the responsiveness for users. The responsiveness of an interactive system describes how quickly it responds to user input Most object file formats are structured as blocks of data, each block containing a certain type of data. These blocks can be paged in as needed by the virtual memory system, needing no further processing to be ready to use. In Computer Operating systems that have their Main memory divided into pages, paging (sometimes called swapping) is a transfer Virtual memory is a Computer system technique which gives an application program the impression that it has contiguous working memory while in fact it may be physically
The simplest object file format is the DOS .COM format, which is simply a file of raw bytes that is always loaded at a fixed location. DOS, short for "Disk Operating System" is a shorthand term for several closely related Operating systems that dominated the IBM PC compatible market Other formats are an elaborate array of structures and substructures whose specification runs to many pages.
Debugging information may either be an integral part of the object file format, as in COFF, or a semi-independent format which may be used with several object formats, such as stabs or DWARF. stabs (sometimes written STABS) is a Debugging data format for storing information about computer programs for use by symbolic and source-level Debuggers DWARF is a widely used standardized Debugging data format. DWARF was originally designed along with ELF, although it is independent of Object file
The GNU Project's BFD library provides a common API for the manipulation of object files in a variety of formats. The GNU Project is a Free software, Mass collaboration project announced in 1983 by Richard Stallman. The BFD or Binary File Descriptor library is the GNU Project 's main mechanism for the portable manipulation of Object files in a variety of formats
Types of data supported by typical object file formats: