title: Where memory segments are defined?
body: <p>I just learned about different memory segments like: Text, Data, Stack and Heap. My question is:</p>
  
  <p>1- Where the boundaries between these sections are defined? Is it in Compiler or OS?</p>
  
  <p>2- How the compiler or OS know which addresses belong to each section? Should we define it anywhere?</p>