26 lines
518 B
Markdown
26 lines
518 B
Markdown
# Linking
|
|
|
|
When Calling Functions in Other Files, We Need to Link Them Together. Because Caller do know how to pass data by calling convention, but do know where the callee is located in memory.
|
|
|
|
## Why Linker Needed?
|
|
|
|
* Modularity
|
|
* Efficiency
|
|
* Time: Seperate Compiliation
|
|
* Space: Libraries
|
|
|
|
## What do Linker do?
|
|
|
|
1. Symbol Resolution
|
|
2. Reloacation
|
|
|
|
## 3 Types of Object
|
|
|
|
1. Relocatable Object File (`*.o`)
|
|
2. Executable File (`a.out`)
|
|
3. Shared Object File (`*.so`)
|
|
|
|
|
|
## ELF* Executable and Linkable Format
|
|
|