title: static linking not providing code in gdb of library api strlen() and puts()
body: <p>I am linking code statically and its 3 line code and after static linkage i am going through disassembled code but while listing i am not getting library api strlen() and puts().</p>
  
  <pre><code>(gdb) disassemble main
  Dump of assembler code for function main:
     0x00000000004004b4 &lt;+0&gt;:     push   %rbp
     0x00000000004004b5 &lt;+1&gt;:     mov    %rsp,%rbp
     0x00000000004004b8 &lt;+4&gt;:     sub    $0x10,%rsp
     0x00000000004004bc &lt;+8&gt;:     movq   $0x0,-0x8(%rbp)
     0x00000000004004c4 &lt;+16&gt;:    mov    -0x8(%rbp),%rax
     0x00000000004004c8 &lt;+20&gt;:    mov    %rax,%rdi
     0x00000000004004cb &lt;+23&gt;:    callq  0x4016c0 &lt;puts&gt;
     0x00000000004004d0 &lt;+28&gt;:    leaveq
     0x00000000004004d1 &lt;+29&gt;:    retq
  
  (gdb) disassemble puts
  Dump of assembler code for function puts:
  =&gt; 0x00000000004016c0 &lt;+0&gt;:     mov    %rbx,-0x18(%rsp)
     0x00000000004016c5 &lt;+5&gt;:     mov    %rbp,-0x10(%rsp)
     0x00000000004016ca &lt;+10&gt;:    mov    %rdi,%rbp
     0x00000000004016cd &lt;+13&gt;:    mov    %r12,-0x8(%rsp)
     0x00000000004016d2 &lt;+18&gt;:    sub    $0x18,%rsp
     0x00000000004016d6 &lt;+22&gt;:    callq  0x40b870 &lt;strlen&gt;
     0x00000000004016db &lt;+27&gt;:    mov    0x2a816e(%rip),%r8        # 0x6a9850 &lt;stdout&gt;
     0x00000000004016e2 &lt;+34&gt;:    mov    %rax,%r12
     0x00000000004016e5 &lt;+37&gt;:    cmpw   $0x0,(%r8)
     0x00000000004016ea &lt;+42&gt;:    mov    %r8,%rbx
     0x00000000004016ed &lt;+45&gt;:    js     0x401740 &lt;puts+128&gt;
     0x00000000004016ef &lt;+47&gt;:    mov    0x88(%r8),%rdx
     0x00000000004016f6 &lt;+54&gt;:    mov    %fs:0x10,%r9
     0x00000000004016ff &lt;+63&gt;:    cmp    %r9,0x8(%rdx)
     0x0000000000401703 &lt;+67&gt;:    je     0x40173c &lt;puts+124&gt;
  
  (gdb) list
  1       #include &lt;stdio.h&gt;
  2       int
  3       main()
  4       {
  5           char *p = NULL;
  6           printf("%s\n", p);
  7       }
  (gdb) q
  </code></pre>
  
  <p>It always displays my code and not library api even when i have kept breakpoint inside puts()/strlen().</p>