question about -fPIC and 32-bit x86 (on linux-elf)
Arkadiusz Pawlik
apawlik@V-LO.krakow.pl
Thu Aug 12 16:51:00 GMT 2004
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)
More information about the Gcc
mailing list