Linkers, Loaders & Executables
Which statement is correct about files in the ELF format commonly used on Linux and similar systems?
- AIt is only for executables and cannot be used for object files
- BIt is used for object files, executables and shared libraries alike, and consists of a header, sections and so on
- CIt is a format for storing images
Show answer and explanation
Answer: B. It is used for object files, executables and shared libraries alike, and consists of a header, sections and so on
ELF (Executable and Linkable Format) is the program file format used by Linux, many other UNIX-like systems and embedded devices. The ELF header at the start records the target CPU, whether it is 64-bit, the address where execution starts and more, followed by sections such as .text and .data and program headers describing what the loader maps into memory. Windows uses the PE format and macOS uses Mach-O.
- A. Object files and shared libraries are also ELF.
- B. Correct. It stands for Executable and Linkable Format.
- C. It is a format for programs.