04. System Software and Program Execution .pdf
0.97MB
Static Linking vs. Dynamic Linking
▶ Static Linking
- Static Library: Linker에서 프로그램의 실행파일 코드에 포함된다. (binding: compile time)
- 실행파일의 크기가 커진다.
- 동일한 라이브러리를 각각의 프로세스가 메모리에 올리므로, 메모리가 낭비된다.
▶ Dynamic Linking
- Shared Library: Loader에서 라이브러리가 실행 시 link된다. (binding: loading or run time)
- 실행파일에는 라이브러리 자체가 포함되는 것이 아니라(just mapping), 라이브러리의 위치를 찾기 위한 간단한 코드만 둔다.
- 라이브러리가 이미 메모리에 있으면 그 루틴의 주소로 가고, 없으면 디스크에서 읽어온다. --> 메모리 낭비x
Static Library vs. Shared Library
- Static Library --> Static Linking
- Shared Library --> Dynamic Linking
Shared Library
▶ Shared Library 장점
- Many processors share one library function in memory. --> Less memory space
예) many a.out's calls printf() -- one copy shared.
▶ Shared Library 단점
- Cannot give a.out to others who do not have library.
Do they have shared library files? Same version? - Slower (실행파일 + a: Library call, Binding and loading at run time)
- Heavy overhead in initial bookeeping during gcc.
'시스템sw및실습' 카테고리의 다른 글
[시소실] 6. Linux Practice (1) (0) | 2023.10.04 |
---|---|
[시소실] 5. Linux (0) | 2023.10.04 |
[시소실] 4. System Software and Program Execution (1) (0) | 2023.09.23 |
[시소실] 3. Procedure Call in MIPS (3) (0) | 2023.09.21 |
[시소실] 3. Procedure Call in MIPS (2) (0) | 2023.09.18 |