From ArchWiki
Revision as of 19:51, 25 July 2011 by Unikum (talk | contribs) (Usage)
Jump to: navigation, search
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 Fixed in glibc 2.13-4 (see


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



following command prelink all the binaries in the directories given by /etc/prelink.conf

# prelink -amR
Warning: It has been observed that if you are low on disk space and you prelink your entire system then there is a possibility that your binaries may be truncated. The result being a b0rked system. Use the file or readelf command to check the state of a binary file. Alternatively, check the amount of free space on your harddrive ahead of time with df -h.

Removing prelink

Removing prelinking from all binaries

# prelink -au

See also