This is the mail archive of the gcc@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]

Re: question about -fPIC and 32-bit x86 (on linux-elf)


On Thu, 12 Aug 2004, Andreas Schwab wrote:
Jonathan Wilson <jonwil@tpgi.com.au> writes:
What does -fPIC give you that not using -fPIC doesnt give you?
The ability to share the text segment between all instances of the shared
library.

As you say, PIC enables sharing of the text segments of shared libraries. I wonder why program binaries are usually compiled position-dependant, because this way multiple instances of the same
program do not share program's code (only shared libraries).
Is executable's code prelinked to some specific base address shared by all applications? (my concern applies mainly to GNU/Linux on x86)



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