home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!soda.berkeley.edu!adam
- From: adam@soda.berkeley.edu (Adam J Richter)
- Newsgroups: comp.os.linux
- Subject: Re: shared libs
- Date: 12 Sep 1992 21:24:55 GMT
- Organization: University of California, Berkeley
- Lines: 32
- Message-ID: <18tn77INNjji@agate.berkeley.edu>
- References: <1992Sep12.171316.19047@athena.mit.edu>
- NNTP-Posting-Host: soda.berkeley.edu
-
- In article <1992Sep12.171316.19047@athena.mit.edu> pmacdona@tadpole.bcsc.gov.bc.ca writes:
- >Does using PIC
- >generate Position Independant Data (PID) as well [...?]
-
- If you reflect upon it, you'll realize that doing position
- independent data is not particularly different from doing position
- independent code on a 386, since the initialized and uninitialized
- data sections are located at known displacements from the program
- counter.
-
- Indeed GCC does generate position independent data, apparently
- following the convention described in the _System V Application Binary
- Interface: Intel386(tm) Processor Supplement_.
-
- To see an example of how this convention works, try compiling
- a small program position independent assembly language like so:
-
- gcc -fpic -S foo.c
-
- where foo.c might contain something like:
-
- int var;
- main() {
- var = 5;
- }
-
-
- --
- Adam J. Richter 409 Evelyn Avenue, Apt. 312
- richter@cerf.net Albany, CA 94706
- (510)528-3209
- Another member of the League for Programming Freedom (league@prep.ai.mit.edu).
-