www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/11/14/04:14:58

Date: Mon, 14 Nov 94 01:10:12 EST
From: dliu AT faraday-gw DOT njit DOT edu (Dong Liu)
To: Aaron Ucko <UCKO AT VAX1 DOT ROCKHURST DOT EDU>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Shared libraries
References: <01HJFWVQUHS2004BDK AT VAX1 DOT ROCKHURST DOT EDU>
Mailer: VM 5.32 (beta) for GNU Emacs 18.59.5

>>>>> On Sun, 13 Nov 1994 19:19:26 -0500 (CDT), Aaron Ucko <UCKO AT VAX1 DOT ROCKHURST DOT EDU> said:

Aaron> Pardon my ignorance again, but...what's -fPIC?  And don't the object-file
Aaron> utilities included in GCC allow it to be able to deal with both COFF and ELF
Aaron> format objects?...just my non-cents :-)

Here is what I read from gcc.info:

`-fpic'
     Generate position-independent code (PIC) suitable for use in a
     shared library, if supported for the target machine.  Such code
     accesses all constant addresses through a global offset table
     (GOT).  If the GOT size for the linked executable exceeds a
     machine-specific maximum size, you get an error message from the
     linker indicating that `-fpic' does not work; in that case,
     recompile with `-fPIC' instead.  (These maximums are 16k on the
     m88k, 8k on the Sparc, and 32k on the m68k and RS/6000.  The 386
     has no such limit.)

     Position-independent code requires special support, and therefore
     works only on certain machines.  For the 386, GNU CC supports PIC
     for System V but not for the Sun 386i.  Code generated for the IBM
     RS/6000 is always position-independent.

     The GNU assembler does not fully support PIC.  Currently, you must
     use some other assembler in order for PIC to work.  We would
     welcome volunteers to upgrade GAS to handle this; the first part
     of the job is to figure out what the assembler must do differently.

`-fPIC'
     If supported for the target machine, emit position-independent
     code, suitable for dynamic linking and avoiding any limit on the
     size of the global offset table.  This option makes a difference
     on the m68k, m88k and the Sparc.

The remark of gas does not fully support PIC seems out of date now.

---
Dong Liu  <dliu AT ace DOT njit DOT edu>
Electrical and Computer Engineering Department
New Jersey Institute of Technology, Newark, NJ 07102

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019