so i am confused now.
That's exactly what RTLD_NODELETE
means: dlclose
on such a library is (effectively) a no-op. Since the code effectively behaves as if dlclose
has never been called, it's little wonder that subsequent dlopen
doesn't reload the code either (it also becomes effectively a no-op).
how can i keep global viriables in dynamic library when using dlopen to reload it. (update the functions but leave the virables not changed)
You can't.