In: Computer Science
INTRODUCTION TO COMPUTER SYSTEMS
Explain the term relocation. Explain the structure of a Typical ELF
executable object file.
Explain the term relocation. Explain the structure of a Typical ELF executable object file.
Relocation is the process of assigning load addresses for position-dependent code and data of a program and adjusting the code and data to reflect the assigned addresses. Some architectures avoid relocation entirely by deferring address assignment to run time; this is known as zero address arithmetic .Prior to the advent of multiprocess systems, and still in many embedded systems, the addresses for objects were absolute starting at a known location, often zero. Since multiprocessing systems dynamically link and switch between programs it became necessary to be able to relocate objects using position-independent code. A linker usually performs relocation in conjunction with symbol resolution.
In computing, the Executable and Linkable Format (ELF) , formerly named Extensible Linking Format), is a common standard file format for executable files, object code, shared libraries, and core dumps. First published in the specification for the application binary interface (ABI) of the Unix operating system version named System V Release 4 (SVR4), and later in the Tool Interface Standard, it was quickly accepted among different vendors of Unix systems.
By design, the ELF format is flexible, extensible, and cross-platform. For instance it supports different endiannesses and address sizes so it does not exclude any particular central processing unit (CPU) or instruction set architecture. This has allowed it to be adopted by many different operating systems on many different hardware platforms.
In this figure an ELF file has two views: the program header shows the segments used at run time, whereas the section header lists the set of sections of the binary.