| |
executive relocation
Relocation is the process of replacing references to symbols with actual addresses during fragment preparation and it is typically done by the Linker. Compilers or assemblers typically generate the object code with zero as the starting address. Before the execution of object code, these addresses should be adjusted so that they denote the correct runtime addresses.
Relocation is typically done in two steps:
1. Each object code has various sections like code, data, bss etc. To combine all the objects to a single executable, the linker merges all sections of similar type into a single section of that type. The linker then assigns runtime addresses to each section and each symbol. At this point, the code (functions) and data (global variables) will be having unique runtime addresses.
2. Each section refers executive relocation services to one or more symbols which should be modified so that they point to the correct runtime addresses.
|