The easy alternative is to link to shared libraries by, say, a SHA-256 hash of their contents. That gives you memory sharing without letting third-parties break your code.
When it's a chunk of code, link against it as a static library. When it's a resource, run it as a service and talk to it via some suitable rpc protocol.