NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/41205: find already loaded library by basename

>Number:         41205
>Category:       lib
>Synopsis:       ld.elf_so does not find already loaded library
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 14 18:15:00 +0000 2009
>Originator:     Arto Huusko
>Release:        NetBSD 5.99.10
    Consider this. Two libraries

    - /path/to/server/
    - /path/to/
      This library has NEEDED
    - Neither libjvm nor libverify is on LD_LIBRARY_PATH
    - Executable dlopens by complete path name.
    - dlopens by complete path name.
    -> Loading fails, because is not found.

    I am unsure if this should even work, but apparently it does on
    Linux and Solaris. I thought I'd submit this anyway, so it does not
    get lost.

    This problem occurs with Java 6u14 and the new plugin.
    Starting Java apps is not a problem (with java -jar ... for example),
    because apparently Java launcher finds, and then adjusts
    LD_LIBRARY_PATH and execs the vm. However, using the new browser plugin
    does not work, because the plugin ( loads directly
    in to the browser process, and can't adjust LD_LIBRARY_PATH anymore.
    Therefore loading fails, because ld.elf_so
    does not find for
    I wrote the following simple patch to see if any of the already loaded
    objects has the same basename as the requested library when complete
    path is not specified:

Index: search.c
RCS file: /cvsroot/src/libexec/ld.elf_so/search.c,v
retrieving revision 1.21
diff -r1.21 search.c
>       /* Search by name from already loaded objects */
>       for (obj = _rtld_objlist->next ; obj != NULL ; obj = obj->next) {
>               char *namestart = strrchr(obj->path, '/');
>               if (namestart != NULL) {
>                       if (strcmp(++namestart, name) == 0)
>                               goto pathfound;
>               }
>       }

Home | Main Index | Thread Index | Old Index