title: Why do I get the same address every time I build + disassemble a function inside GDB?
body: <p>Every time when I disassemble a function, why do I always get the same instruction address and constants' address?</p>
  
  <p>For example, after executing the following commands,</p>
  
  <pre><code>gcc -o hello hello.c -ggdb
  gdb hello
  (gdb) disassemble main
  </code></pre>
  
  <p>the dump code would be:</p>
  
  <p><img src="https://i.stack.imgur.com/HihdH.png" alt="dump code"></p>
  
  <p>When I quit gdb and re-disassemble the main function, I will get the same result as before. The instruction address and even the address of constants are always the same for each disassemble command in gdb. Why is that? Does the compiled file <code>hello</code> contain certain information about the address of each assembly instruction as well as the constants' addresses?</p>