Linker and Libraries Guide

Creating a Shared Object

The following example combines the above points.


$ cc -c -o foo.o -K pic -xregs=no%appl foo.c
$ cc -M mapfile -G -o libfoo.so.1 -z text -z defs -B direct -z lazyload \
-z ignore -R /home/lib foo.o -L. -lbar -lc

The following example combines the above points.


$ cc -M mapfile -G -o libfoo.so.1 -z text -z defs -B direct -z lazyload \
-z ignore -R /home/lib -h libfoo.so.1 foo.o -L. -lbar -lc
$ ln -s libfoo.so.1 libfoo.so