Closing and reloading compiled extensions

I would like to be able to do the following:

  1. Write and compile a C extension containing nothing but singleton
    methods defined on “self”.
  2. Load the extension multiple times, attaching these methods to
    different objects.
  3. Make changes to the extension, rebuild it, and replace the defined
    methods on select objects.

#1 is easy, #2 can be done by linking multiple singletons to the same

But #3 cannot be done, because I can’t dlclose() extensions.

Why not?

I know I could just create new instances of the interpreter.
I don’t want to do this - I want to be able to create a unified,
persistent object model that avoids the hassle of IPC, but still has the
ability to load and unload dynamically compiled machine code.

Do I need to create my own extension loading/unloading library? Or is
there an obscure feature or upstream patch I’m not aware of?