Possible Duplicate:
shared library address space
I am bit confused about the memory layout of Shared Library during Execution. Let me put what i understand.
.so file is one where code is not duplicated in each binary and hence single copy exists. The binaries will get GOT and other tables updated and with that it uses the functions.
While I was trying understand how; i got the following link http://www.openbsd.org/papers/nycbsdcon08-pie/mgp00010.html. Now if you see this, all the shared libraries are "mmaped" to the process memory. This is obvious as it has to be in its own memory space.
If we have a BSS/Data section, that has to be duplicated between the processes as it will be specific to process. What will happen to .TEXT sections? Will it be duplicated during run time or its loaded at some place and each binary will map that into its own user space?