Contents
Description
Pre-Linking is a mechanism for linking programs to shared libraries
ahead of time. In general, every time an application is run it must have
its external symbols resolved – looked up in the shared library symbol
table, and fixed up in the program binary to refer to the correct
offsets in the library. To use prelinking, a special utility is run
which does this resolution and fixup once for the program. This saves
the cost of linking at runtime.
There is an existing package from RedHat which provides this feature.
A drawback of this is that if the shared library is changed, the fixups
are no longer correct, and the program must be fixed-up again. This is
much less of an issue in an embedded situation, where the programs and
libraries are less likely to change than in a desktop or server Linux
system.
Overview of linking
There is an excellent paper with an overview of dynamic linking issues
at: Pre Linking
Overview
This paper describes not only pre-linking, but lazy linking and more
exotic systems, like compile-on-load.
Expected Improvement
[This is not measured yet.]
We expect that with use of prelinking, there will be a slight reduction
in boot time for Linux system, in the area of initial application
loading.
We need to use this system and measure the effect of prelinking for a
determined set of applications.
Resources
RedHat prelinking system
A white paper is at:
prelink
prelink currently supports the following architectures: alpha, arm,
cris, i386, ia64, ppc32, ppc64, s390, sh, sparc32, sparc64, x86_64. At
present the glibc dynamic linker is required to prelink executables and
load prelinked code, uClibc does not support it.
Instructions for using prelinking with Gentoo
The following page has information on how to use prelinking with a
Gentoo system:
Related Projects
RelCache vs. Red Hat prelink
Resident – Resident Good (comparisons with prebind)
Specifications
None so far.
Patches
No kernel patches required for kernels 2.4.10 and later.
Case Studies
Case 1 – Panasonic mobile phone prelink
Panasonic used pre-linking on their Linux-based mobile phones. These
used a 2.4.x Linux kernel, for an ARM processor. Measuring the time to
load a single multimedia application with regular dynamic linking and
pre-linking, showed that pre-linking could save a lot of time.
Hardware
ARM9 (unspecified CPU frequency)
Kernel Version
2.4.20 (based on Monta Vista Linux CEE 3.1), glibc 2.3
Time without change
2479 ms
Time with change
125 ms
Source
Case 2
Case 3
Future Work
This item is a work-in-progress, and we are just getting started.
Material from CELF presentations
ARM Prelink
Japan Jamboree #3
http://tree.celinuxforum.org/CelfPubWiki/JapanTechnicalJamboree3
In the presentation of “Making Mobile Phone with CE Linux”, the
evaluation of Prelink on ARM architecture was mentioned.
by Mr. Mizuyama (Panasonic Mobile)
MIPS Prelink
预链接(pre-linking)是一种用于提前将程序与共享库链接的技术,旨在减少运行时链接开销。它通过一次性解决外部符号并修复程序二进制文件,以指向库中正确的偏移量。尽管在共享库更改后需要重新修复,但在嵌入式系统中,由于程序和库变更较少,这一问题影响较小。预链接在Linux系统的启动时间和初始应用程序加载方面预期能带来性能提升。例如,Panasonic在其基于Linux的移动电话上使用预链接,结果显示预链接显著减少了多媒体应用程序的加载时间。目前,预链接主要支持多种架构,包括alpha、arm等,并需要glibc动态链接器。对于使用Gentoo系统的用户,有特定的预链接使用指南。

630


被折叠的 条评论
为什么被折叠?



