I used to apply -fPIC option when I was compiling shared library in Linux but I didn't know much about PIC at that time, so I just typed it as if it is a convention.
Recently I read about PIC in wiki and several websites, and I think I understand general concept now. However, I found that including -fPIC option not only when compiling & linking a shared library, but also a executable (a.out) makes almost no difference in behavior at first glance such as compile error or something. For example I tested a simple Hello world program in C++ with and without -fPIC option, and both of all work well without any error.
In this case, I am wondering which is the difference that -fPIC makes in behaviour. All I've got is slight difference in addresses and _GLOBAL__sub_I_(sth) by checking objdump -t. Additionally, I am curious about if there will be any harmful effect while compiling executable with -fPIC option.
Thanks in advance!