4 ms·
> Can someone explain a couple use cases for something like this? At this point, it would be more useful if someone explained a couple of use cases for dynamic
by enriquto 3y ago
> Can someone explain a couple use cases for something like this?
At this point, it would be more useful if someone explained a couple of use cases for dynamic linking.
- pjmlp 3y agoPlugins, unless you want to have one process per plugin. Which in the days of running Kubernetes clusters on laptops maybe isn't a big deal.
- enriquto 3y agoYou can still call dlopen from your static binary, if you really want to.
- pjmlp 3y agoSure lets go back to 1980's UNIX, it was such a great experience.
- mappu 3y agoI tried to do this recently at $DAYJOB, but when you statically link a binary with musl, the dlopen() you get is a no-op: https://github.com/bpowers/musl/blob/master/src/ldso/dlopen.c https://github.com/bpowers/musl/blob/master/src/ldso/dlopen.... I tried to hack in a copy of the musl's dynamic loader (and also from old uclibc). But it took a few hours and my only result was segfaults. Do you have any pointers on making this work?
- enriquto 3y agoHave you tried it with glibc? It's harder to build static binaries with it, but it's still possible, and it may work. To debug your problem, do you have a minimal example at your fingertips to try? Just a "hello world" dynlib that is called from a static program that doesn't do anything else.