cvs: php4 / INSTALL

[email protected] ("Sascha Schumann")
Newsgroups php.version4
Message-ID <cvssas959102601@cvsserver>
sas		Tue May 23 19:23:21 2000 EDT

  Modified files:
    /php4	INSTALL 
  Log:
  Add interesting email which explains why disabling -fPIC works on Linux
  by Martin v. Loewis <[email protected]>
  
  
Index: php4/INSTALL
diff -u php4/INSTALL:1.14 php4/INSTALL:1.15
--- php4/INSTALL:1.14	Mon May 15 16:40:20 2000
+++ php4/INSTALL	Tue May 23 19:23:21 2000
@@ -296,6 +296,47 @@
    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 <[email protected]>
+    To: [email protected]
+    Subject: Re: Shared library -shared vs. -fpic
+
+    [In reply to Kaz Kylheku <[email protected]>]
+
+    > 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.