Skip to content

발표자료 {7. Linking} {CSAPP}

Linking#

  • Static linking at compile time
  • Dynamic linking at load time
  • Dynamic linking at runtime

Compiler Drivers#

Pasted image 20230908134433.png


Static linking#

  • Symbol resolution
  • Relocation

Object files#

  • relocatable object files
  • executable object files
  • shared object files

Relocatable object files#

Pasted image 20230908135524.png


Symbols and Symbol Tables#

같은 이름의 다른 함수에 있는 static 변수는 에러 난다? 아니다?


Symbol Resolution#

Linker Symbol Entry


Relocation#


Executable Object Files#

Pasted image 20230910104459.png


Loading Executable Files#

Pasted image 20230908145952.png


Dynamic Linking with Shared Libraries#

  • -fpic
  • -shared

PIC?#

  • Position
  • Independent
  • Code

Library Interpositioning#


실습#

Library {C} ldd로 필요 library 확인하기