Subject: Re: RelCache (aka ELF prebinding) news
To: None <tech-kern@netbsd.org, tech-userlevel@netbsd.org>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: tech-kern
Date: 12/03/2002 12:14:19
On Wed, Dec 04, 2002 at 02:04:41AM +0900, Bang Jun-Young wrote:
> 
> (Idea of using metadata was dropped, since no one could get the same
> value from the same file after it's moved back and forth).

You should use the length and the filename, no matter what.  I'd call
that "metadata", but maybe you wouldn't. :-)  You don't need to include
them in the checksum, just use them as separate data to match the cache
entry against.  That is basically without cost and makes a collision
even less likely, as collisions against data of different lengths are
excluded.  And you can still move the file around and not rebind so
long as you move it back.

Other system-wide prebinding schemes seem to also use the modification 
time of the file, and SGI's appears to use the inode number.  Thus the 
other schemes require rebinding if you move your shared libraries around.  
I suppose from one point of view, it is an advantage of your system that it 
doesn't do that, though in practice I think it's likely that if you move
your libraries, you will need to rebind...

Using the mtime but not the inum would let you not rebind after a 
backup/restore, even.

-- 
 Thor Lancelot Simon	                                      tls@rek.tjls.com
   But as he knew no bad language, he had called him all the names of common
 objects that he could think of, and had screamed: "You lamp!  You towel!  You
 plate!" and so on.              --Sigmund Freud