summaryrefslogtreecommitdiff
path: root/INSTALL
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-05-23 17:23:21 +0000
committerSascha Schumann <sas@php.net>2000-05-23 17:23:21 +0000
commitdec92a445f63d4df09faf1c088f160d4ee675e16 (patch)
tree7b24a0116bce0d4529235ab21cc3a75897f53846 /INSTALL
parent617266e33efa1739e76dc8a2e34d028f80815ac2 (diff)
downloadphp-git-dec92a445f63d4df09faf1c088f160d4ee675e16.tar.gz
Add interesting email which explains why disabling -fPIC works on Linux
by Martin v. Loewis <martin@loewis.home.cs.tu-berlin.de>
Diffstat (limited to 'INSTALL')
-rw-r--r--INSTALL41
1 files changed, 41 insertions, 0 deletions
diff --git a/INSTALL b/INSTALL
index 2970bfb380..a875086d2d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -296,6 +296,47 @@ Installing PHP can be done in four simple steps:
Note! If a line has a # at the beginning, then it is commented out
and you need to remove the # for that line to take effect.
+WHY DISABLING -fPIC WORKS ON LINUX
+
+ From: Martin v. Loewis <martin@loewis.home.cs.tu-berlin.de>
+ To: glibc-linux@ricardo.ecn.wfu.edu
+ Subject: Re: Shared library -shared vs. -fpic
+
+ [In reply to Kaz Kylheku <kaz@ashi.footprints.net>]
+
+ > PIC stands for Position-Independent Code.
+
+ Correct.
+
+ > Code isn't position-independent (or ``relocatable'') cannot be
+ > loaded at an arbitrary address;
+
+ Wrong.
+
+ > it requires some references to be patched at load time.
+
+ Correct.
+
+ > Shared libraries need to be relocatable because it's not known
+ > beforehand what address they will be loaded at
+
+ Correct, depending on the meaning of "relocatable". PIC code typically
+ does not contain relocations; that's why its position-independent.
+
+ > Just because you don't specify -fPIC doesn't mean that the compiler
+ > won't emit position-independent code; the option prevents it from
+ > emitting position-dependent code in situations where it otherwise
+ > would.
+
+ Correct. However, a non-trivial shared library typically won't be
+ position-independent unless explicitly compiled with
+ -fPIC. Linux/glibc indeed does not require a shared library to be
+ position-independent; instead, it will perform the relocations in the
+ binary, even if they refer to code pages. As a result, those relocated
+ pages won't be shared across processes, anymore.
+
+ Regards,
+ Martin
USING PHP 3 AND PHP 4 AS CONCURRENT APACHE MODULES