In this week's GWN there is an article mentioning a post on these forums where some people were caught unawares by a library change in libexpat. This is just a quick tip to show people how prelink can not only speed up your system by decreasing load times, but also alert you to any problems with your library linking so that you know when you need to run revdep-rebuild (*).

First things first, you need to install prelink and get it working. There is an excellent guide on the Gentoo site which documents this process. Once you have prelink up and running I reccomend running it with the following options:

Code:

prelink -amfR

This instructs prelink that it should consider all binaries (-a), try to conserve virtual memory space (-m), force prelinking of all binaries (-f), and randomize the addresses used in the virual memory space (-R). This combination of options is advantageous because they not only serve to keep your system running as quickly as possible, but they also present a "moving target" to any attackers who might attempt to exploit a buffer overflow and utilise your system's libraries once they've gained control over your instruction pointer.

Prelink operates under the traditional UNIX model of brevity, i.e. if nothing is outputted it worked as it was supposed to. If prelink is unable to link your binaries correctly it will display an error to that effect and continue with its work. Thus we come to the point of this tip, which is that prelink will notify you of any linking problems such as was encountered recently with the new libexpat version.

I run the above prelink command after every emerge, it only takes a minute or two. If there are any errors when prelinking I know that some library or another has changed and I need to run revdep-rebuild. Once revdep-rebuild has finished I can run prelink again and everything should come back fine. In this way I not only know that my applications are loading as quickly as possible, I also know that they are correctly linked against all of the libraries which they require.