title: a single copy of a shared module’s code segment can be shared?
body: <p>I'm reading a textbook which says:</p>
  <blockquote>
  <p>modern systems compile the code segments of shared modules so that
  they can be loaded anywhere in memory without having to be modified by
  the linker. With this approach, a single copy of a shared module’s
  code segment can be shared by an unlimited number of processes and
  each process will still get its own copy of the read/write data
  segment.</p>
  </blockquote>
  <p>But how does each process get its own copy of the data segment of shared modules? isn't it a conflict? for example the address in memory for data segement of a shared library is 0x400500 to 0x400600 and the address for code segement is 0x400600 to 0x400700.</p>
  <p>0x400600 to 0x400700  can be shared by multiple processes since functions don't have state, but if 0x400500 to 0x400600 is also shared by multiple processes, any process that makes a modification(e.g. on a global variable) will affect other processes, is that correct?</p>