1.**Symbol resolution**. The linker phase in which each symbol reference is associated with exactly one symbol definition.
2.**Relocation**. The linker phase in which code and data sections across input modules are combined. Each section, along with the symbols defined in them, are assigned unique run-time memory addresses. Additionally, references to symbols are updated so they point to the correct run-time addresses.
According to Bryant et al., a static linker must perform what two tasks?
Back: Symbol resolution and relocation.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1733671136073-->
END%%
%%ANKI
Basic
Which of symbol resolution or relocation happens first?
Back: Symbol resolution.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
After which linker phase is the size of the code and data sections of each input object module known?
Back: Symbol resolution.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Back: To associate each symbol reference with exactly one symbol definition.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
The {symbol resolution} phase associates each {symbol reference} with exactly one {symbol definition}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Back: To assign a memory location to each symbol and update references accordingly.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1733671136084-->
END%%
%%ANKI
Basic
*Why* must relocation happen after symbol resolution?
Back: We should not assign multiple addresses to the same symbol.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1733671136097-->
END%%
%%ANKI
Basic
What does it mean for a linker to relocate a code and/or data section?
Back: It associates a memory location with each symbol definition and updates references accordingly.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
1. [[relocatable|Relocatable object files]]. Contains binary code and data in a form that can be combined with other relocatable object files at compile time.
2.**Executable object files**. Contains binary code and data in a form that can be copied directly into memory and executed.
3.**Shared object files**. A special type of relocatable object file that can be loaded into memory and linked dynamically, at either load time or run time.
An **object module** is a sequence of bytes whereas an **object file** is an object module stored on disk.
%%ANKI
Basic
What are the three types of object files?
Back: Relocatable, executable, and shared.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734356868367-->
END%%
%%ANKI
Basic
Executable object files are outputs of which compiler driver component?
Back: The linker.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1734356868399-->
END%%
%%ANKI
Basic
Executable object files are inputs into which compiler driver component?
Back: N/A.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1734356868406-->
END%%
%%ANKI
Basic
What is an object module?
Back: A sequence of bytes.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734356868413-->
END%%
%%ANKI
Basic
In terms of object modules, what is an object file?
Back: An object module stored on disk.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734356868418-->
END%%
%%ANKI
Basic
What distinguishes an object module from an object file?
Back: An object file is an object module stored on disk.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734356868423-->
END%%
%%ANKI
Basic
In what way is the term "object file" misused by Bryant et al.?
Back: Technically this term only refers to object modules on disk.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
A {shared} object file is a special case of a {relocatable} object file.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.