Shim me baby one more time

I was reading the ‘Basics on how shims work‘, and all I could think about was the old linux/unix trick of using LD_PRELOAD to intercept library calls in dynamically linked applications (used to great effect to bypass timebombed applications).
It is one of the reasons why I think that static linking is just horrible – after all, it breaks things, and makes you have to use terribly complicated tricks like disassembling and binary patching to fix problems because you don’t have the source code. You don’t get the advantages of page sharing, which is kind of important when you consider how many libraries are loaded by the typical gnome application (last check on nautilus was 117 libraries, excluding VDSO and the binary itself, firefox has 151, excluding fonts and other pango related nonsense). Yes, indeed, winners don’t use static linking.
As a tangent, it’s one of the reasons for not using application compression tools on binaries – after all, the only thing you save is on the distribution size, not on the run-time. The binary itself acts like a static linked blob, and doesn’t share the text segment (program code) amongst the other instances, like other binaries, so every instance can use a lot of private memory, leaving less physical memory on the machine for other things like playing high resolution video.