Q: It's possible to share data-section (veriables) between twice `dlopen`ed sahrdLib in the same process? On linux platform, if a sharedLib are opened tiwce with dlopen in the same process, are the data-section(variables) located in the same mem-address or not?
I want to initialize a global var in the shardLib on first dlopen, and use it (by dlsym) with the second dlopen, is it possiable?
void* hdl0 = dlopen("foo.so");
void* varPtr = dlsym(hdl0, "var_name");
*varPtr = INIT_VALUE;

void* hdl1 = dlopen("foo.so");
void* varPtr = dlsym(hdl1, "var_name");
// I expect the var has value 'INIT_VALUE' here

