Subject: Re: New idea on ELF prebinding
To: Bang Jun-Young <junyoung@netbsd.org>
From: Luke Mewburn <lukem@netbsd.org>
List: tech-userlevel
Date: 11/22/2002 18:38:01
On Fri, Nov 22, 2002 at 04:27:30PM +0900, Bang Jun-Young wrote:
| > | - Every binary, including executable and shared object, has .csum
| > | section inserted by ld(1) at compile time. It is 32-bit long and
| > | used for storing checksum (CRC32) of the binary.
| >
| > i'd prefer md5 or sha1 as a hash.
|
| The basic idea is to use the checksum as a filename to lookup. For
| example, if the checksum is FB369ADB, then ld.elf_so(1) tries to
| find a file of the same name in /usr/libdata/reloc. So you don't
| have to worry about moving binaries.
i'd prefer the preload stuff is tied to the csum, dev_t and ino_t of
the file, so that the cache is invalidated if the file moves...
|
| I thought about MD5 as well, but it is too long to be used as a file
| name. Probably a better method would be needed...
as jason mentioned, there's a performance issue with md5 as well.
| > | If needed, elfreld(1) daemon regularly check if they are
| > | still valid, and removes invalid files. Or you can remove
| > | all of them, and ld.elf_so(1) will perform the same job
| > | again for each binary it loads.
| >
| > do we even need an elfreld daemon? does it matter if the cache grows.
|
| So that someone won't complain about ever-growing cache directory. ;-)
oh, /var/db/reloc/ is a *directory* ... i missed that in my first
reading of the idea.
luke.