Roland Mainz wrote:

> Question for the linker folks/aliens: Would it make sense to use _both_
> "-Bdirect" (e.g. OS/Net default) and -"z lazyload" at the same time ? At
> least "dbx" does not seem to care about -Bdirect and loads all libraries
> while using "-z lazyload" causes "dbx" to load the libraries "on demand"
> ...

-Bdirect enables -z lazyload, so adding the latter to the former
is a noop.   I don't understand how dbx's behavior would be changed
over using these two options.

You can confirm what you've asked for with elfdump(1).  Direct
bindings are recorded in the Syminfo section, so are lazy loads:

chaz 401. elfdump -y /lib/libnsl.so.1 | fgrep libmp.so.2
       [39]  DBL          [1] libmp.so.2               mp_mtox
      [236]  DBL          [1] libmp.so.2               mp_pow
      [291]  DBL          [1] libmp.so.2               mp_mdiv
      [350]  DBL          [1] libmp.so.2               mp_mult
      .....

DB = directly bound.
L  = lazy load.

Lazy loads also show up in the .dynamic section:

chaz 400. elfdump -d /lib/libnsl.so.1

Dynamic Section:  .dynamic
      index  tag                value
        [0]  POSFLAG_1         0x1                 [ LAZY ]
        [1]  NEEDED            0x8e20              libmp.so.2
        ...

There are a number of options, -z lazyload/nolazyload and
-z direct/nodirect, and some mapfile options, that can provide
fine-grained control over lazy loading and direct binding.
-Bdirect is the simple big hammer, and all most folks should need.

If you want to know all the possible binding permutations:

http://docs.sun.com/app/docs/doc/819-0690/aehzq?l=en&a=view

-- 
Rod

Reply via email to