What happens to global and static variables in a shared library when it is dynamically linked?
问题 I\'m trying to understand what happens when modules with globals and static variables are dynamically linked to an application. By modules, I mean each project in a solution (I work a lot with visual studio!). These modules are either built into *.lib or *.dll or the *.exe itself. I understand that the binary of an application contains global and static data of all the individual translation units (object files) in the data segment (and read only data segment if const). What happens when this