146k views
4 votes
Consider the following process for generating binaries. A compiler is used to generate the object code for individual modules, and a linkage editor is used to combine multiple object modules into a single program binary. How does the linkage editor change the binding of instructions and data to memory addresses? What information needs to be passed from the compiler to the linkage editor to facilitate the memory-binding tasks of the linkage editor?

2 Answers

2 votes

Final answer:

The linkage editor assigns final memory addresses to the instructions and data of a program by combining individual object modules created by the compiler. It requires information such as symbol tables, relocation information, and external symbol references to perform relocation and resolve external references. After the linkage process, the program binary is ready to be loaded into memory for execution.

Step-by-step explanation:

The linkage editor (or linker) is responsible for resolving references between individual object modules and assigning final memory addresses to the instructions and data. During the compilation phase, the compiler generates object code for each module, where symbols (like function names and variables) are not yet bound to specific memory locations. Instead, they're typically represented by placeholders or symbolic references.

For the linker to appropriately combine these individual modules into a single program binary, it must perform a process known as 'relocation'. This involves adjusting the symbolic references so they point to the definitive memory addresses. The binding of symbols to memory locations becomes absolute at this stage. Additionally, the linker handles the resolution of external references—symbols that are defined in other modules. To facilitate this, the compiler needs to provide the linker with information such as symbol tables (which contain names and relative addresses of symbols), relocation information (to indicate which parts of the code need fixing up), and external symbol references.When the linkage editor completes its task, the final executable contains all the necessary code and data with correct references to memory locations, ready to be loaded into memory and executed by the system.

User Amique
by
5.7k points
3 votes

Answer:

The answer of this question is described in the explanation part.

Step-by-step explanation:

  • The connection operator will substitute unresolved conceptual addresses with the real addresses aligned with either the end system decimal parameters.
  • To do this, the modules should keep records of directives which relate to ambiguous signals.
  • In the relating, each configuration in the application framework binary is assigned a pattern of domain names.
  • This has been done, problematic connections to objects imported by this unit may be substituted in other frameworks because each other system would contain the set of instructions to be repaired for.

User Stephen Curran
by
5.6k points