Difference between revisions of "Prelink"

From ArchWiki
Jump to: navigation, search
(Removing prelink)
(See also)
Line 26: Line 26:
* [http://linux.die.net/man/8/prelink Prelink man page]
* [http://linux.die.net/man/8/prelink Prelink man page]
* [http://www.gentoo.org/doc/en/prelink-howto.xml Gentoo Linux Prelink Guide]
* [http://www.gentoo.org/doc/en/prelink-howto.xml Gentoo Linux Prelink Guide]
* [http://crast.us/james/articles/prelink.php ELF Prelinking and what it can do for you]

Revision as of 19:41, 25 July 2011

Warning: On systems with glibc 2.13, prelink has been reported to prevent all dynamic executables from starting, rendering the system unbootable. Use prelink on glibc 2.13 with caution. See discussion at https://bbs.archlinux.org/viewtopic.php?pid=884465 Fixed in glibc 2.13-4 (see https://bugs.archlinux.org/task/22656)


Most programs require libraries to function. Libraries can be integrated into a program once, by a linker, when it is compiled (static linking) or they can be integrated when the program is run by a loader, (dynamic linking). Dynamic linking has advantages in code size and management, but every time a program is run, the loader needs to find the relevant libraries. Because the libraries can move around in memory, this causes a performance penalty, and the more libraries that need to be resolved, the greater the penalty. prelink reduces this penalty by using the system's dynamic linker to reversibly perform this linking in advance ("prelinking" the executable file) by relocating. Afterward, the program only needs to spend time finding the relevant libraries on being run if, for some reason (perhaps an upgrade), the libraries have changed since being prelinked.


Prelink is available through pacman

pacman -S prelink


All settings are in /etc/prelink.conf



On 32-bit setups:

# prelink -amR

On 64-bit setups:

# prelink -aR

Removing prelink

# prelink -au

See also