2

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.

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
Rob Wells
  • 36,220
  • 13
  • 81
  • 146

2 Answers2

2

Starting with Solaris 11 (and some of the OpenSolaris & Solaris Express releases leading up to it, but not Solaris 10 or older), there is now an elfedit tool for modifying runtime paths and similar attributes.

alanc
  • 4,102
  • 21
  • 24
  • now if only you could get the links broken by Oracle fixed on Oracle's own sites (such as the post you linked to)... (thanks for fixing them on SO btw) – mark4o Aug 18 '12 at 19:48
  • Yeah, the breakage of links all over is annoying. For that post, you can see the [elfedit(1) manpage](http://docs.oracle.com/cd/E23824_01/html/821-1461/elfedit-1.html#scrolltoc) from the Solaris 11 man pages now that the release is out, and substitute blogs.oracle.com for blogs.sun.com in the other links. – alanc Aug 19 '12 at 01:26
2

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.

alanc
  • 4,102
  • 21
  • 24
mark4o
  • 58,919
  • 18
  • 87
  • 102
  • 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 Sep 15 '09 at 15:48
  • And of course, the brother to `lari` and `moe` is the [crle](http://docs.oracle.com/cd/E23824_01/html/821-1461/crle-1.html#scrolltoc) utility for dealing with the system default run paths. – alanc Aug 18 '12 at 06:06