home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!convex!linac!unixhub!unixhub.slac.stanford.edu!alhy
- From: alhy@unixhub.slac.stanford.edu (J. Scott Berg)
- Newsgroups: comp.unix.aix
- Subject: stripped shared objects
- Message-ID: <5454@unixhub.SLAC.Stanford.EDU>
- Date: 10 Sep 92 23:15:01 GMT
- Sender: news@unixhub.SLAC.Stanford.EDU
- Reply-To: alhy@unixhub.slac.stanford.edu
- Organization: Stanford University, dept of Physics / SLAC
- Lines: 47
- Nntp-Posting-Host: courant.slac.stanford.edu
-
- Consider two ways of using shared objects:
-
- 1) Create a shared object, and link it directly with your main program
-
- ld sub.o -o subshr.o -s -bE:sub.exp -bM:SRE -T512 -H512 -bh:4
- xlc main.c subshr.o -o main -s
-
- This works great, even though the shared object is stripped. It
- apparently looks in the loader section to get the exported symbols and
- finds them just fine.
-
- 2) Create a shared object, put it in a library, and use the -l flag to
- include the library
-
- ld sub.o -o shrsub.o -s -bE:sub.exp -bM:SRE -T512 -H512 -bh:4
- ar cr libsub.a subshr.o
- xlc main.c -L. -lsub -o main -s
-
- This bombs. The last compilation says that subshr.o in libsub.a has
- been stripped (which it has). What I would like to have happen
- (ideally) is that just as case 1) uses the loader section to find the
- exported symbols, so should case 2). Is there a way I can do this?
-
- The reason that I want to do this is that I came up with this clever
- idea when compiling a library that consisted of a LARGE number of
- shared objects, and when I stripped them all before putting them in
- the library, the library was about HALF its size! It's a big library,
- so this made me very happy, until I actually tried to use the library
- and it bombed. By default, I use -x instead of -s (to only keep
- external symbols), but that doesn't seem to help as much.
-
- Any help is greatly appreciated. Thanks and God bless
-
- -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) 326-2631 (h)
- -------------------------------------------------------------------------------
-
-