Alfred Perlstein <[EMAIL PROTECTED]> writes:
> I'm having a hell of a time doing this so I can produce a static
> .o or .a with most of the symbols stripped.  Two problems seem to be
> that even if I use "ld -r -o main.o obj1.o obj2.c libfoo.a" then I
> can not strip symbols in obj1.o that are referenced from obj2.o
> even after I combine the object files.

You can link all your object files into one:

$ ld -r -o all.o foo.o bar.o baz.o

then strip unwanted symbols with {objcopy,strip} -N (or better yet,
use {objcopy,strip} -K to strip all symbols except the ones you want
to export)

this is precisely what we do with klds to reduce namespace pollution.

DES
-- 
Dag-Erling Sm�rgrav - [EMAIL PROTECTED]
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to