nanogui: stripping libraries
Subject:
stripping libraries
From:
Robert Hartley ####@####.####
Date:
31 Jan 2001 12:14:57 -0000
Message-Id: <3A78027F.A673F67E@ics.com>
Alex,
I was having problems with unresolved references.
I put libc, libm, and ld-2.0.7.so in my /lib fdirectory.
It was kind of big, so I ran the strip command on it, and it shrank way down and
fits nicely on the Helio:
ls -l /opt/tvt/helio-image/root/lib/
total 1624
-rwxrwxr-x 1 root root 361302 Jan 29 14:42 ld-2.0.7.so*
lrwxrwxrwx 1 root root 11 Jan 30 15:51 ld.so.1 -> ld-2.0.7.so*
-rwxr-xr-x 1 root root 991360 Jan 29 14:15 libc-2.0.7.so*
lrwxrwxrwx 1 root root 13 Jan 30 15:51 libc.so.6 ->
libc-2.0.7.so*
-rwxr-xr-x 1 root root 287572 Jan 29 14:15 libm-2.0.7.so*
lrwxrwxrwx 1 root root 13 Jan 30 15:51 libm.so.6 ->
libm-2.0.7.so*
I think the trick is to strip the shared library after it is built.
For example, trying:
file /lib/libc-2.1.3.so
on my Mandrake 7.2 system returned:
/lib/libc-2.1.3.so: ELF 32-bit LSB shared object, Intel 80386, version 1,
stripped
I do not remember stripping them myself, (although I may have accidently)
Robert
Alex Holden wrote:
> On Wed, 31 Jan 2001, Yu Xuanwei wrote:
> > > Don't do that- strip removes the symbols which are needed when linking the
> > > objects together. You can strip the program after it's been linked
> > > together.
> > I doubt it. As far as I know, a striped library is available.
>
> [alex@hyperspace tea-total]# rm -f teatotal
> [alex@hyperspace tea-total]# strip *.o
> [alex@hyperspace tea-total]# make teatotal
> gcc -s -o teatotal teatotal.o teauntea.o tea-kgen.o randdev.o tead.o
> teatun.o teash.o teacp.o teaprot.o huffman.o heap.o base64.o md5.o btea.o
> readkey.o lineget.o util.o getarg.o
> /usr/lib/crt1.o: In function `_start':
> /usr/lib/crt1.o(.text+0x36): undefined reference to `main'
> collect2: ld returned 1 exit status
> make: *** [teatotal] Error 1
> [alex@hyperspace tea-total]#
>
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
= Robert Hartley Mail: 201 Broadway =
= Central Region Systems Engineer Cambridge, MA 02139 =
= Integrated Computer Email: ####@####.#### =
= Solutions, Inc. Web Site: www.ics.com =
= Tech Support: ####@####.#### Phone: 800-800-4271 =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Visit the MotifZone (www.motifzone.org) for info on Motif!