Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unexpected prelink output (wants to do too much)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
dreamer3
Guru
Guru


Joined: 24 Sep 2002
Posts: 553

PostPosted: Sat Jan 04, 2003 12:39 pm    Post subject: Unexpected prelink output (wants to do too much) Reply with quote

Running prelink -nv /bin/tar results in a LONG list of things to be prelinking including X, KDE, and others.

Am I wrong, or shouldn't this command only show me /bin/tar and it's associated libraries?
Back to top
View user's profile Send private message
idl
Retired Dev
Retired Dev


Joined: 24 Dec 2002
Posts: 1728
Location: Nottingham, UK

PostPosted: Sat Jan 04, 2003 5:42 pm    Post subject: Reply with quote

yeh i find that kinda weird.. but prelink does what you tell it on the command line then also does whats in /etc/prelink.conf
Back to top
View user's profile Send private message
snowmoon
n00b
n00b


Joined: 05 Jun 2002
Posts: 64
Location: Albany,NY USA

PostPosted: Sat Jan 04, 2003 6:04 pm    Post subject: Reply with quote

That's completly right...

prelinking works by first identifing ALL libraries in your system. If you understand how it works it would make perfect sense.

1) It loads up all libraries known to the system.

2) It gives each library it's own unique non-overlapping address in the 4gb virtual memory space.

3) It can now link all executable and libraries together before they are run since all markup addresses are already known.

So pre-linking will work to a point, but since desktop systems will probably not grow to have more than 4gb of libraries in the near future we should be ok.

Since each libraries address needs to be unique for this to work prelink must first identify all libraries in the system and that's exactly what you are seeing.
Back to top
View user's profile Send private message
dreamer3
Guru
Guru


Joined: 24 Sep 2002
Posts: 553

PostPosted: Sat Jan 04, 2003 8:39 pm    Post subject: Reply with quote

snowmoon wrote:
That's completly right...

prelinking works by first identifing ALL libraries in your system. If you understand how it works it would make perfect sense.

Unless you specify just a single file or library... then the man pages indicate that it should work with just that file and associated libraries... at least that's how I read it, so my question still remains.
Back to top
View user's profile Send private message
BigRedDot
n00b
n00b


Joined: 29 Oct 2002
Posts: 67
Location: Austin

PostPosted: Sun Jan 05, 2003 2:00 am    Post subject: Reply with quote

Quote:
Unless you specify just a single file or library... then the man pages indicate that it should work with just that file and associated libraries... at least that's how I read it, so my question still remains.


I don't think it can possibly work that way. As mentioned, in order for prelinking to work at all, each library must have a unique virtual address. That can't be done in isolation. You may only be interested in this one executable on the command line "right now" but based on what's in prelink.conf, prelink knows that it is also responsible in general for all those other libraries as well. It can't generate a unique identifier for the dependencies of your one executable in a vacuum -- it has to take all the others it might ever be responsible for into account too, in order to avoid conflicting with an already used address, or giving two different addresses to the same libraries.
_________________
Even if you are one-in-a-million, there are still 6000 people just like you.
Back to top
View user's profile Send private message
dreamer3
Guru
Guru


Joined: 24 Sep 2002
Posts: 553

PostPosted: Sun Jan 05, 2003 4:21 am    Post subject: Reply with quote

BigRedDot wrote:
I don't think it can possibly work that way. As mentioned, in order for prelinking to work at all, each library must have a unique virtual address.

Actually the "unique" numbers can be not so unique as long as they are unique per library or executable that is called. ie, you can't have two the same in one file, but for two seperate programs with seperate sets of libraries you can. That's what the -m option is all about.
Quote:
That can't be done in isolation. You may only be interested in this one executable on the command line "right now"...

man prelink wrote:
ARGUMENTS
Command line arguments should be either directory hierar-
chies (in which case -l and -h options apply), or particu-
lar ELF binaries or shared libraries. Unlike when walking
directory hierarchies, specifying a shared library
explicitely on the command line causes it to be prelinked
even if no binary is linked against it. Normally, only
binaries are collected together with all libraries they
depend on
.

The last sentences implies that I can link just a executable and it's dependent libraries. Too bad this is so new and there are really no "experts", just all of us trying to make heads or tails of it.

Edit: Ok, maybe this isn't what that line says. *sighs* Now I'm even more confused.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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