View previous topic :: View next topic |
Author |
Message |
dreamer3 Guru
Joined: 24 Sep 2002 Posts: 553
|
Posted: Sat Jan 04, 2003 12:39 pm Post subject: Unexpected prelink output (wants to do too much) |
|
|
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 |
|
|
idl Retired Dev
Joined: 24 Dec 2002 Posts: 1728 Location: Nottingham, UK
|
Posted: Sat Jan 04, 2003 5:42 pm Post subject: |
|
|
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 |
|
|
snowmoon n00b
Joined: 05 Jun 2002 Posts: 64 Location: Albany,NY USA
|
Posted: Sat Jan 04, 2003 6:04 pm Post subject: |
|
|
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 |
|
|
dreamer3 Guru
Joined: 24 Sep 2002 Posts: 553
|
Posted: Sat Jan 04, 2003 8:39 pm Post subject: |
|
|
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 |
|
|
BigRedDot n00b
Joined: 29 Oct 2002 Posts: 67 Location: Austin
|
Posted: Sun Jan 05, 2003 2:00 am Post subject: |
|
|
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 |
|
|
dreamer3 Guru
Joined: 24 Sep 2002 Posts: 553
|
Posted: Sun Jan 05, 2003 4:21 am Post subject: |
|
|
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 |
|
|
|