g++ -fPIC not producing position independent code
<p>I've read the topic <a href="https://stackoverflow.com/questions/5311515/gcc-fpic-option">GCC -fPIC option</a></p>

<p>So I've created my testlib.cpp.</p>

<pre><code>int foo(int num)
{   
    int result;

    if (num != 0)
    {
        result = 1;
    }
    else
    {
        result = 2;
    }

    return result;
}
</code></pre>

<p>When I compile as 
<strong>g++ -c -o testlib.o testlib.cpp</strong>
and as 
<strong>g++ -fPIC -c -o testlib.o testlib.cpp</strong>
the corresponding objdumps of testlib.o are identical:</p>

<p><strong>objdump -d testlib.o -M intel</strong></p>

<pre><code>testlib.o:     file format elf32-i386

Disassembly of section .text:

00000000 &lt;_Z3fooi&gt;:
   0:   55                      push   ebp
   1:   89 e5                   mov    ebp,esp
   3:   83 ec 10                sub    esp,0x10
   6:   83 7d 08 00             cmp    DWORD PTR [ebp+0x8],0x0
   a:   74 09                   je     15 &lt;_Z3fooi+0x15&gt;
   c:   c7 45 fc 01 00 00 00    mov    DWORD PTR [ebp-0x4],0x1
  13:   eb 07                   jmp    1c &lt;_Z3fooi+0x1c&gt;
  15:   c7 45 fc 02 00 00 00    mov    DWORD PTR [ebp-0x4],0x2
  1c:   8b 45 fc                mov    eax,DWORD PTR [ebp-0x4]
  1f:   c9                      leave  
  20:   c3                      ret   
</code></pre>

<p>And I expected the addresses of arguments of <em>jump</em> and <em>je</em> commands to be position independent when compiling with -fPIC. So the two objdumps should be different. What do I understand wrong?</p>