home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / linux / 10572 < prev    next >
Encoding:
Text File  |  1992-09-12  |  1.4 KB  |  44 lines

  1. Path: sparky!uunet!spool.mu.edu!agate!soda.berkeley.edu!adam
  2. From: adam@soda.berkeley.edu (Adam J Richter)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: shared libs
  5. Date: 12 Sep 1992 21:24:55 GMT
  6. Organization: University of California, Berkeley
  7. Lines: 32
  8. Message-ID: <18tn77INNjji@agate.berkeley.edu>
  9. References: <1992Sep12.171316.19047@athena.mit.edu>
  10. NNTP-Posting-Host: soda.berkeley.edu
  11.  
  12. In article <1992Sep12.171316.19047@athena.mit.edu> pmacdona@tadpole.bcsc.gov.bc.ca writes:
  13. >Does using PIC
  14. >generate Position Independant Data (PID) as well [...?]
  15.  
  16.     If you reflect upon it, you'll realize that doing position
  17. independent data is not particularly different from doing position
  18. independent code on a 386, since the initialized and uninitialized
  19. data sections are located at known displacements from the program
  20. counter.
  21.  
  22.     Indeed GCC does generate position independent data, apparently
  23. following the convention described in the _System V Application Binary
  24. Interface: Intel386(tm) Processor Supplement_.
  25.  
  26.     To see an example of how this convention works, try compiling
  27. a small program position independent assembly language like so:
  28.  
  29.         gcc -fpic -S foo.c
  30.  
  31.     where foo.c might contain something like:
  32.  
  33.         int var;
  34.         main() {
  35.           var = 5;
  36.         }
  37.  
  38.  
  39. -- 
  40. Adam J. Richter                409 Evelyn Avenue, Apt. 312
  41. richter@cerf.net            Albany, CA 94706
  42.                     (510)528-3209
  43. Another member of the League for Programming Freedom (league@prep.ai.mit.edu).
  44.