This chapter describes the executable and linking format (ELF) of the object files produced by the assembler and link-editor. There are three main types of object files:
A relocatable file holds code and data suitable to be linked with other object files to create an executable or shared object file, or another relocatable object.
An executable file holds a program that is ready to execute. The file specifies how exec(2) creates a program's process image.
A shared object file holds code and data suitable to be linked in two contexts. First, the link-editor can process it with other relocatable and shared object files to create other object files. Second, the runtime linker combines it with a dynamic executable file and other shared objects to create a process image.
The first section in this chapter, "File Format", focuses on the format of object files and how that pertains to building programs. The second section, "Dynamic Linking", focuses on how the format pertains to loading programs.
Programs manipulate object files with the functions contained in the ELF access library, libelf. Refer to elf(3E) for a description of libelf contents. Sample source code that uses libelf is provided in the SUNWosdem package under the /usr/demo/ELF directory.