relocatable code and object files and shared libraries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
1)Are all object files are relocatable???

http://ehuss.com/shared/
The above  link says
"To create a shared library, you write the code like you normally
would. When you go to compile your code, you should indicate that the
code needs to be "position independent". You do this with the gcc
compile option "-fPIC". For example:

    gcc -fPIC -c my_library.c "

2) If we dont use -fPIC will the object file produced will not be relocatable??
3) What exactly does relocatable code means? any links explaning it please.
4) Why do we need shared library when we can create object files which
are relocatable??
5)Why the size of shared library file(*.so) is very large than the
object file from which it is produced??
Thanks in advance

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux