For example, if I declare a function in the main application, and a pass a pointer to it, from a dynamically loaded library (via dlopen under Linux or LoadLibrary under Windows) using a gotten symbol argument (via dlsym or GetProcAddress respectively) and try to call that function, would it work properly?
Same if pass pointer from one dynamically loaded library to another? I think it should work if pointer at least relative to application but not relative to module/library.
Another example. I declare a function in one application and pass pointer to it to another fully-independent application (both C and C++) somehow (parameter string or file i/o - idk how, just an idea) and try to call this function, would it work too? I could expect it to work if the pointers are absolute. Maybe it just won't work because system won't like such cross-call at all because of safety?