are runtime linking library globals shared among plugins loaded with dlopen?

Posted by conejoroy on Stack Overflow See other posts from Stack Overflow or by conejoroy
Published on 2010-05-07T07:42:12Z Indexed on 2010/05/07 7:48 UTC
Read the original article Hit count: 223

Filed under:
|
|
|
|

I've a C++ program that links at runtime with, lets say, mylib.so. then, the same program uses dlopen()/dlsym() to load a function from myplugin.so, dynamic library that in turn has dependencies to mylib.so.

My question is: will the program AND the function in the plugin access the same globals defined in mydlib.so in the same memory area reserved for the program, or each will be assigned different, unrelated copies in its own memory space? if the latter is the default behaviour, is it possible to change that?

Thanks in advance =)!

© Stack Overflow or respective owner

Related posts about linux

Related posts about gcc