ld.so 上下文中的预链接是什么意思,LD_TRACE_PRELINKING 如何影响它
What is prelinking in the context of ld.so mean and how does LD_TRACE_PRELINKING affect it
我试图了解我可以操作 ld.so
的所有方式,但我无法理解 LD_TRACE_PRELINKING
环境变量的文档。
联机帮助页说:
LD_TRACE_PRELINKING (since glibc 2.4)
If this environment variable is defined, trace prelinking of the object whose name is assigned to this environment variable. (Use ldd(1) to get a list of the objects that might be traced.) If the object name is not recognized, then
all prelinking activity is traced.
这不是很有用,因为我找不到关于上下文 ld.so
中对象的 prelinking 的任何信息,以及它是否也是激活 LD_TRACE_LOADED_OBJECTS
.
时跟踪
那么,什么是 prelinking in ld.so
以及 LD_TRACE_PRELINKING
如何影响 ld.so
?
动态loader/linker(如ld.so
)必须在程序开始执行时和动态加载共享库时执行符号解析和绑定操作。其中一些活动可以提前执行而无需实际执行程序代码,并且可以缓存结果以供在实际执行期间使用。这改进了启动时间和整体程序执行时间。在 linux 上,prelink
是驱动此优化的工具,其核心功能在 ld.so
中实现。
我试图了解我可以操作 ld.so
的所有方式,但我无法理解 LD_TRACE_PRELINKING
环境变量的文档。
联机帮助页说:
LD_TRACE_PRELINKING (since glibc 2.4)
If this environment variable is defined, trace prelinking of the object whose name is assigned to this environment variable. (Use ldd(1) to get a list of the objects that might be traced.) If the object name is not recognized, then
all prelinking activity is traced.
这不是很有用,因为我找不到关于上下文 ld.so
中对象的 prelinking 的任何信息,以及它是否也是激活 LD_TRACE_LOADED_OBJECTS
.
那么,什么是 prelinking in ld.so
以及 LD_TRACE_PRELINKING
如何影响 ld.so
?
动态loader/linker(如ld.so
)必须在程序开始执行时和动态加载共享库时执行符号解析和绑定操作。其中一些活动可以提前执行而无需实际执行程序代码,并且可以缓存结果以供在实际执行期间使用。这改进了启动时间和整体程序执行时间。在 linux 上,prelink
是驱动此优化的工具,其核心功能在 ld.so
中实现。