Difference between revisions of "Prelink"

From ArchWiki
Jump to: navigation, search
(Created page with "==Method== 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 integrat...")
 
(Prelinking)
Line 10: Line 10:
 
==Usage==
 
==Usage==
 
===Prelinking===
 
===Prelinking===
 
+
On 32-bit setups:
 
  # prelink -amR
 
  # prelink -amR
 +
 +
On 64-bit setups:
 +
# prelink -aR
  
 
===Removing prelink===
 
===Removing prelink===
 
  # prelink -au
 
  # prelink -au

Revision as of 18:47, 23 December 2010

Method

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.

Installing

Prelink is available through pacman

pacman -S prelink

Configuration

All settings are in /etc/prelink.conf

Usage

Prelinking

On 32-bit setups:

# prelink -amR

On 64-bit setups:

# prelink -aR

Removing prelink

# prelink -au