Search code examples
linuxdlopen

In Linux, how do I dlopen a shared object stored uncompressed inside another file?


A few years ago I heard Google had a patch to dlopen a shared object stored inside another file at a non-zero offset, or mmap'd, instead of sitting in its own standalone file. Did that ever land? What's the API for loading these objects?


Solution

  • Did that ever land in Linux mainline?

    1. This has nothing to do with Linux mainline: GLIBC is a completely separate project from Linux kernel (which is what people usually call "Linux mainline").
    2. No; we still carry it as a local patch. It works with restrictions, which make it somewhat unsuitable for upstream.

    What's the API for loading these objects?

    void *dlopen_with_offset(const char *name, off_t offset, int flags);