3 ms·
> you always have to load the whole library into memory Not really. You do have to mmap it, but it can be demand-paged (executables are handled this way on mos
by 0xcde4c3db 10y ago
> you always have to load the whole library into memory
Not really. You do have to mmap it, but it can be demand-paged (executables are handled this way on most modern systems, which is why compressed executables are usually a bad idea). IIRC, what saves time is mostly not having to do the actual linking part where the references are resolved. This can be precomputed and stashed in the binary (an optimization well-known to Gentoo+KDE users), but that confuses some package managers, breaks some uses of dlopen()/dlsym(), and has issues with ASLR.