Subject: Re: reducing library searches in ld.elf_so
To: Bang Jun-Young <junyoung@mogua.com>
From: Charles Hannum <abuse@spamalicious.com>
List: current-users
Date: 09/22/2002 19:34:25
While your patch may help a little, I do not think it's sufficient
even to fully mitigate the problem you're talking about.  The problem
is that it only affects lookup hits, not misses, and so a certain
number of missed lookups will occur in many (most?) cases anyway.

Perhaps better would be to hook into:

        for (sp = _rtld_paths; sp != NULL; sp = sp->sp_next)
                if ((pathname = _rtld_search_library_path(name, namelen,
                    sp->sp_path, sp->sp_pathlen)) != NULL) 
                        return (pathname);

(and the _rtld_default_paths case below it), and to record both
positive and negative hits here by file name (without the path).  This
would allow us to do a simple table lookup the next time we see the
file name.