title: more info on Memory layout of an executable program (process)
body: <p>I attended interview for samsung. They asked lot of questions on memory layout of the program.  I barely know anything about this.</p>
  
  <p>I googled it "Memory layout of an executable program". "Memory layout of process".</p>
  
  <p>I'm surprised to see that there isn't much info on these topics. Most of the results are forum queries. I just wonder why? </p>
  
  <p>These are the few links I found:</p>
  
  <ol>
  <li><a href="http://lambda.uta.edu/cse5317/notes/node33.html" rel="noreferrer">Run-Time Storage Organization</a></li>
  <li><a href="http://homepage.mac.com/randyhyde/webster.cs.ucr.edu/www.artofasm.com/Windows/HTML/MemoryAccessandOrg.html#999687" rel="noreferrer">Run-Time Memory Organization</a></li>
  <li><a href="http://www.cs.uleth.ca/~holzmann/C/system/memorylayout.gif" rel="noreferrer">Memory layout of C process</a> <a href="http://www.cs.uleth.ca/~holzmann/C/system/memorylayout.pdf" rel="noreferrer">^pdf^</a></li>
  </ol>
  
  <p>I want to learn this from a proper book instead of some web links.(Randy Hyde's is also a book but some other book). In which book can I find clear &amp; more information on this subject?</p>
  
  <p>I also wonder, why didn't the operating systems book cover this in their books? I read stallings 6th edition. It just discusses the Process Control Block.</p>
  
  <p>This entire creation of layout is task of <code>linker</code> right? Where can I read more about this process. I want <strong>COMPLETE</strong> info from a program on the disk to its execution on the processor.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Initially, I was not clear even after reading the answers given below. Recently, I came across these articles after reading them, I understood things clearly. </p>
  
  <p><strong>Resources that helped me in understanding:</strong></p>
  
  <blockquote>
    <ol>
    <li>www.tenouk.com/Bufferoverflowc/Bufferoverflow1b.html</li>
    <li>5 part PE file format tutorial: <a href="http://win32assembly.online.fr/tutorials.html" rel="noreferrer">http://win32assembly.online.fr/tutorials.html</a></li>
    <li><strong>Excellent</strong> article : <a href="http://www.linuxforums.org/articles/understanding-elf-using-readelf-and-objdump_125.html" rel="noreferrer">http://www.linuxforums.org/articles/understanding-elf-using-readelf-and-objdump_125.html</a></li>
    <li>PE Explorer: <a href="http://www.heaventools.com/" rel="noreferrer">http://www.heaventools.com/</a></li>
    </ol>
  </blockquote>
  
  <p>Yes, "layout of an executable program(PE/ELF)" != "Memory layout of process"). Findout for yourself in the 3rd link. :)</p>
  
  <p>After clearing my concepts, my questions are making me look so stupid. :)</p>