I did a "Hello World" program using the pthread library. I compile it this simple way:
$ gcc main.c -lpthread
According to gcc Documentation ("Options for Linking" section):
-llibrary [...] The linker searches a standard list of directories for the library, which is actually a file named liblibrary.a. The linker then uses this file as if it had been specified precisely by name. [...]
So, my understanding is: gcc is looking for libpthread.a . Given the .a ending, this should be a static library.
However, this is dynamically linked:
$ ldd a.out
linux-vdso.so.1 => (0x00007fffde3c3000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb345820000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb345456000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb345a3d000)
What am I missing?