Dynamic Linking in C: Shrinking Executables and Sharing Code
摘要
When developers first discover that their simple "Hello, World!" program is 16KB instead of a few hundred bytes, they often wonder where all those extra bytes come from. The answer lies partly in static linking—every program carries its own copy of library code. But what if multiple programs could share the same library code? Enter dynamic linking, a clever solution that not only shrinks executables but also enables features that would be impossible with static linking alone.