home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / aix / 8964 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  2.0 KB

  1. Path: sparky!uunet!ogicse!uwm.edu!linac!unixhub!unixhub.slac.stanford.edu!alhy
  2. From: alhy@unixhub.slac.stanford.edu (J. Scott Berg)
  3. Newsgroups: comp.unix.aix
  4. Subject: Size of shared libraries
  5. Message-ID: <5259@unixhub.SLAC.Stanford.EDU>
  6. Date: 20 Aug 92 23:38:27 GMT
  7. Article-I.D.: unixhub.5259
  8. Sender: news@unixhub.SLAC.Stanford.EDU
  9. Reply-To: alhy@unixhub.slac.stanford.edu
  10. Organization: Stanford University, dept of Physics / SLAC
  11. Lines: 37
  12. Nntp-Posting-Host: courant.slac.stanford.edu
  13.  
  14. It seems that when I make shared libraries, they're much larger than
  15. an unshared version of the same library!  Here's what I do in this
  16. case:  I take a library (the ibm blas library), extract all the object
  17. files, on each of the files use nm to determine the symbols to export,
  18. create an import file with all the routine names in it, then do the
  19. following command on each object:
  20.  
  21. ld -lxlf -lm -lc -bh:4 -T512 -H512 -x -bM:SRE -bI:blas.inp -o \
  22.   obj.shr.o obj.o -bE:obj.exp ; mv obj.shr.o obj.o
  23.  
  24. I then put them together into an archive:
  25.  
  26.   ar -cr libblas.a *.o
  27.  
  28. -r--r--r--   1 bin       693241 Nov 05 1990  /lib/libblas.a <-- orig ibm
  29. -rw-r--r--   1 alhy     1338637 Aug 20 16:34 libblas.a <-- shared version
  30.  
  31. Do I need to do something differently?  Is it the alignment with -T512
  32. and -H512 that's killing me?  Am I right in assuming that if I use ld
  33. to combine all the objects into one big shr.o, that ALL the routines
  34. will be loaded simultaneously, even if I use only one, and that the
  35. way I did it, only the routines used will be loaded?  Thanks much
  36.  
  37.                 -Scott Berg
  38.  
  39.  
  40. -- 
  41. -------------------------------------------------------------------------------
  42. The opinions expressed here are, of course, my own and nobody else's.
  43. -------------------------------------------------------------------------------
  44. J. Scott Berg
  45. email: alhy@unixhub.slac.stanford.edu
  46. real mail: Varian Physics
  47.            Stanford  CA  94305-4060
  48. phone:    (415) 926-4732 (w)
  49.      (415) 328-8246 (h)
  50. -------------------------------------------------------------------------------
  51.