使用 HP-UX 时,我可以使用 chatr 实用程序来报告共享库的各种内部属性。它还允许我修改我构建的共享库的内部属性。
chatr 实用程序可以报告并在某些情况下进行修改,例如:
- 运行时绑定(bind)行为,
- 在构建时创建的嵌入式库路径列表,
- 库是否需要运行时路径查找,
- 内部名称,
- 等等,等等
这样的实用程序可用于 Solaris 吗?
编辑:太奇怪了!感谢下面 mark4o 的回答,我重新访问了典型系统 .so(Sol 10 上的 libm.so.2)的 elfdump 输出。然而,奇怪的是,我输错了输入命令:
elfdump libm.so.2 | moe
在一次令人惊奇的机缘巧合中,这给了我一个名为 moe 的实用程序的使用消息,该实用程序的手册页描述部分显示:
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.
这将帮助我解决为什么 libm.so.2 shlib 在两台不同的机器上不兼容,导致我的不完整的可执行文件无法在一台服务器上启动。
最佳答案
关于unix - 如何查看共享对象的内部属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1427762/