How kernel, compiler, and C library work together: Difference between revisions

m
[unchecked revision][unchecked revision]
Line 47:
== Static Linking ==
 
When linking statically, the linker is invoked during the build process, just after the compiler / assembler run. It takes the object code, checks it for unresolved references, and checks if it can resolve these references from the available libraries. It then adds the binary code from these libraries to the executable; after this process, the executable is ''complete'', i.e. when running it does not require anything but the kernel to be present.
takes the object code, checks it for unresolved references, and checks if it can resolve these references from the
available libraries. It then adds the binary code from these libraries to the executable; after this process, the
executable is ''complete'', i.e. when running it does not require anything but the kernel to be present.
 
On the downside, the executable can become quite large, and code from the libraries is duplicated over and over, both on disk and in memory.
both on disk and in memory.
 
== Dynamic Linking ==
50

edits