This chapter describes the executable and linking format (ELF) of the object files produced by the assembler and link-editor. Three significant types of object file exist.
A relocatable object file holds sections containing code and data. This file is suitable to be linked with other relocatable object files to create dynamic objects, kernel modules, or another relocatable object.
A executable file holds a program that is ready to execute. The file specifies how exec(2) creates a program's process image. This file is typically bound to shared object files at runtime to create a process image.
A shared object file holds code and data that is suitable for additional linking. The link-editor can process this file with other relocatable object files and shared object files to create other object files. The runtime linker combines this file with an executable file and other shared object files to create a process image.
Programs can manipulate object files with the functions that are provided by the ELF access library, libelf. Refer to elf(3ELF) for a description of libelf contents. Sample source code that uses libelf is provided in the pkg:/source/demo/system package under the /usr/demo/ELF directory.