Matt Miller wrote:
> All, I've been told this is the alias for questions regarding linking.
> I'm using Studio 12 on Solaris 10. Trying to use -z lazyload and -z 
> nodefs for linking...

First, the two options conflict.  -z lazyload asks that any dependencies
that follow the option should be recorded as lazy dependencies.  -z nodefs
provides for building an object without having to define all its
dependencies.   -z lazyload requires dependencies to be specified.

> The library is linked as:
> 
> ld -G -z lazyload -o ../../../3b2/lib/myso.so [list of
>       .o files] -h myso.so

The -z lazyload flag has no affect here.  When building *any* dynamic object
it is recommended that you define the dependencies that the object requires
to satisfy the symbol references the object makes.  See:

   http://blogs.sun.com/rie/entry/tt_dependencies_tt_define_what

As myso.so has no dependencies specified (no -l's), then there's nothing
that can be tagged for lazily loading.  Define the dependencies that myso.so
needs, and then you can lazily load them.  See:

   http://blogs.sun.com/rie/entry/dependencies_perhaps_they_can_be

>       The executable was linked with the following command:
> 
>       /opt/SUNWspro/bin/cc -z lazyload -z nodefs -L../../../3b2/lib
>       -L/usr/lib -L/3b2/lib -o
>       ../../../3b2/bin/another.o
>       /inc/yetanother.o -lutillib -lnelib

You should never use -z nodefs to build an executable.  To do so would be
to allow references to be unsatisfied if you missed defining the dependency
they require.


-- 

Rod.

Reply via email to