Subject: Re: dynamic linking
To: Frederick Bruckman <fredb@immanent.net>
From: Bang Jun-Young <junyoung@netbsd.org>
List: tech-userlevel
Date: 03/20/2003 01:41:30
On Wed, Mar 19, 2003 at 09:22:01AM -0600, Frederick Bruckman wrote:
> > ld.elf_so needs a hint on where to find libraries. You can add hints in
> > /etc/ld.so.conf (adding /usr/X11R6/lib here is fine),
>
> That's not supposed to work on NetBSD. The file installed with the
> system by default has a different format (and a different purpose).
That should work on NetBSD as well. From libexec/ld.elf_so/paths.c:
doing_path = *b == '/';
if (doing_path) {
size_t tmp = len - 1;
while (b[tmp] == '#' || b[tmp] == ' ' || b[tmp] == '\t')
tmp--;
path_p = _rtld_append_path(head_p, path_p, b, tmp + 1);
} else {
char tmp = b[len];
b[len] = '\0';
_rtld_process_mapping(lib_p, b, len);
b[len] = tmp;
}
Any line starting with '/' in /etc/ld.so.conf leads to a call to
_rtld_append_path().
Jun-Young
--
Bang Jun-Young <junyoung@netbsd.org>