views:

61

answers:

1

When using HP-UX I can use the chatr utility to report on various internal attributes of a shared library. It will also allow me to modify the internal attributes of shared libraries that I have built.

The chatr utility can report, and in some cases modify, such things as:

  1. the run-time binding behaviour,
  2. the embedded library path list created at build time,
  3. whether the library is subject to run-time path lookup,
  4. internal names,
  5. etc., etc.

Is such a utility available for Solaris?

Edit: Freaky! Thanks to mark4o's answer below I revisited the elfdump output for a typical system .so (libm.so.2 on Sol 10). However, and here's the freaky part, I mistyped the command to enter:

elfdump libm.so.2 | moe

In an amazing stroke of serendipity, this gave me back the usage message for a utility called moe whose man page description section says:

The moe utility manifests the optimal expansion of a path-name containing reserved runtime linker tokens. These tokens can be used to define dependencies, filtees and runpaths within dynamic objects. The expansion of these tokens at runtime, provides a flexible mechanism for selecting objects and search paths that perform best on this machine.

This will help me resolve why a libm.so.2 shlib is not compatible on both of two different machines leaving my incomplete executable unable to start on one server.

+1  A: 

For displaying the information, see the Solaris elfdump and pvs utilities. For debugging binding issues, lari and moe may also be helpful. However, these utilities do not have the ability to modify the library.

mark4o
mark4o, cheers, but elfdump doesn't give me exactly what I'm after. However, revisiting the the elfdump output for a given system .so gave me a utility that looks really useful. I'll edit my original question.
Rob Wells
@mark4o, thanks for the pointer to pvs! +1 (-:
Rob Wells