2 ms·
Interestingly enough, I would say that dynamic linking makes binaries smaller, that code no longer lives in the binary, but another place instead.
by steveklabnik 6y ago
Interestingly enough, I would say that dynamic linking makes binaries smaller, that code no longer lives in the binary, but another place instead.
- djeiasbsbo 6y agoI'm pretty sure that for the classic "Hello World" example that's not the case, because we can simply use the linux write system call. For example, an assembly program that just calls write and then exits is much smaller than even an unlinked version of it that uses printf, because the ELF binary doesn't need to contain information for the linker.
- steveklabnik 6y agoYes, on the very very very low end, this is the case, but generally, in more real programs, it's not. (The program I linked is an example of exactly what you're talking about)
- mlyle 6y agoSure. But there's a lot of overhead that comes with it, too.