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