Which of the following is NOT an advantage of using shared, dynamically linked libraries as opposed to using statically linked libraries? A. Smaller sizes of executable files B. Lesser overall page fault rate in the system C. Faster program startup D. Existing programs need not be re-linked to take advantage of newer versions of libraries
GATE 2003 · Compiler Design · Linker · medium
Answer: C. Faster program startup is NOT an advantage of dynamic linking — it is actually slower to start than static linking.
- Analyze each option: A. Smaller executable files: TRUE advantage. Dynamic exe stores only references; library code lives in separate .so/.dll files. Advantage of dynamic linking. B. Lesser overall page fault rate: TRUE advantage. Shared library pages are shared across processes in physical memory — one copy of libc.so serves all programs, reducing total memory footprint and page faults. C. Faster program startup: FALSE — this is NOT an advantage. Dynamic linking requires the loader to find, load, and bind each shared library at startup. This is SLOWER than static linking where all code is already in the executable. D. No re-linking for newer versions: TRUE advantage. Programs using dynamic libraries pick up updates automatically without relinking.
- Confirm C as the non-advantage: For a statically linked program, all library code is embedded. Startup just requires loading one file into memory — fast. For a dynamically linked program, startup requires: (1) load the executable, (2) identify all required shared libraries, (3) locate them on disk, (4) load them into memory, (5) perform symbol relocation/binding (PLT/GOT patching). Steps 2-5 add measurable latency. Programs with many dynamic dependencies (e.g., large Java applications) can have noticeably slow startup.