Subject: Re: RelCache (aka ELF prebinding) news
To: Thor Lancelot Simon <tls@rek.tjls.com>
From: Bang Jun-Young <junyoung@netbsd.org>
List: tech-userlevel
Date: 12/04/2002 03:17:43
On Tue, Dec 03, 2002 at 12:14:19PM -0500, Thor Lancelot Simon wrote:
> 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

I was only thinking of device or inode number. *-) You are right.

> 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.

Filename can be easily changed, so it won't be used. And using length is
basically a good idea but you need a bit tricky method to calculate
actual file length before relcache is appended to the file. 

> 
> 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.

Jun-Young

-- 
Bang Jun-Young <junyoung@netbsd.org>