somehow its pretty sucky that i can't find information which answers this question:
each shared library consists of code (.text) and data (.data, .bss) . thus whenever some process requires such library, the code and data of that library are loaded to some physical memory locations (if not loaded already), and are then mapped to the virtual address space of the process.
so, question 1: when multiple processes require the same shared library, and that library has global variables (.bss), do all processes work on the SAME variables (so that if process A sets some global variable to foo, does another process B also read foo then?) or does each application get its own copy of the variables (the .bss section) of the dll?
question 2: where does the dll exist in the virtual address space of the process?
does some dll exist on the SAME address in ALL address spaces of the processes? or can e.g. process P1 have the dll on address foo and P2 has the same dll mapped to address bar?
question3: so if a process does not need some dll, but that dll is loaded, could it still access it?
i would say no, because if a process does not load some dll, there is no reason for it to be mapped into its address space (thus there is no need creating those segments)
would be glad if someone could give me a link to where i can find the answers :/