title: What's going on in __libc_start_main?
body: <p>I'm really trying to understand the steps from high level code -> executable.. but am having some difficulties. </p>
  
  <p>I've written an empty <code>int main() {}</code> C file and am trying to decipher the disassembly via <code>objdump -d</code>. Here's what's going on:</p>
  
  <ul>
  <li>in <code>_start</code>, set up alignment, push arguments on stack, call <code>__libc_start_main</code></li>
  <li>in <code>__libc_start_main</code>, the first line to execute is <code>jmp *0x8049658</code></li>
  </ul>
  
  <p>However, upon using <code>objdump -R</code> to check out the relocation records, the value in <code>0x8049658</code> is <code>__libc_start_main</code> itself! </p>
  
  <p>I'm missing something here..</p>
  
  <p>edit: here's some of the source;</p>
  
  <pre><code> 080482c0 &lt;__libc_start_main@plt&gt;:
   80482c0:       ff 25 58 96 04 08       jmp    *0x8049658
   80482c6:       68 08 00 00 00          push   $0x8
   80482cb:       e9 d0 ff ff ff          jmp    80482a0 &lt;_init+0x2c&gt;
  
  Disassembly of section .text:
  
  080482d0 &lt;_start&gt;:
   80482d0:       31 ed                   xor    %ebp,%ebp
   80482d2:       5e                      pop    %esi
   80482d3:       89 e1                   mov    %esp,%ecx
   80482d5:       83 e4 f0                and    $0xfffffff0,%esp
   80482d8:       50                      push   %eax
   80482d9:       54                      push   %esp
   80482da:       52                      push   %edx
   80482db:       68 50 84 04 08          push   $0x8048450
   80482e0:       68 e0 83 04 08          push   $0x80483e0
   80482e5:       51                      push   %ecx
   80482e6:       56                      push   %esi
   80482e7:       68 d0 83 04 08          push   $0x80483d0
   80482ec:       e8 cf ff ff ff          call   80482c0 &lt;__libc_start_main@plt&gt;
   80482f1:       f4                      hlt
   80482f2:       66 90                   xchg   %ax,%ax
  
  
  
   DYNAMIC RELOCATION RECORDS
  OFFSET   TYPE              VALUE 
  08049644 R_386_GLOB_DAT    __gmon_start__
  08049654 R_386_JUMP_SLOT   __gmon_start__
  08049658 R_386_JUMP_SLOT   __libc_start_main
  </code></pre>