Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] revdep-rebuild and prelinking
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message

Joined: 21 Apr 2002
Posts: 577

PostPosted: Tue Apr 04, 2006 11:00 am    Post subject: [TIP] revdep-rebuild and prelinking Reply with quote

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:

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.

* For more information on revdep-rebuild see the documentation here.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum