This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-fPIC and shared object


Hello,

I am using linux and I would like to understand the role of -fPIC. I
understand that it generate code where function address can be
calculated indirectly after relocation of the .so in applications
using it. My questions are :

- Is it required to compile with -fPIC every object file packed in a
dynamic shared object ?

- Is is possible to integrate a static library in a .so  safely
(assuming the static library is not compiled using -fPIC)
- Is the answer to the previous question the same if the library is
used only within the boundary of the .so (hidden to the rest of the
application) ?

Thanks
--
Olivier Delannoy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]