Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 2006 16:18:30 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        Konstantin Belousov <kib@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/libexec/rtld-elf rtld.c
Message-ID:  <200609151618.31968.jkim@FreeBSD.org>
In-Reply-To: <200609081459.k88ExtSR084500@repoman.freebsd.org>
References:  <200609081459.k88ExtSR084500@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 08 September 2006 10:59 am, Konstantin Belousov wrote:
> kib         2006-09-08 14:59:55 UTC
>
>   FreeBSD src repository
>
>   Modified files:
>     libexec/rtld-elf     rtld.c
>   Log:
>   When looking up the symbol by dlsym, look it not only in the
> object given as dso handle, but also in the implicit dependencies
> of that dso.
>
>   Also, const-ify the read-only parameter objlist of symlook_list.
>
>   Reported by:    "Simon 'corecode' Schubert" <corecode at fs ei
> tum de> Approved by:    kan (mentor)
>   X-MFC-After:    6.2
>
>   Revision  Changes    Path
>   1.117     +10 -13    src/libexec/rtld-elf/rtld.c

Unfortunately I found a serious regression, which broke OpenOffice.org 
build on -CURRENT:

http://docs.freebsd.org/cgi/mid.cgi?200609142219.19636.nb_root

My simple test case (inspired by an ancient PR) is here:

http://people.freebsd.org/~jkim/rtld-regression.tar.bz

Tested on:

%sysctl -n kern.osreldate
700022
%uname -mr
7.0-CURRENT amd64

------- BEFORE --------
%make test
env LD_LIBRARY_PATH=. ldd main st1.so dl1.so dl2.so dl3.so
main:
        libc.so.7 => /lib/libc.so.7 (0x800634000)
st1.so:
dl1.so:
        dl2.so (0x800e00000)
        dl3.so (0x800f01000)
        st1.so (0x801002000)
dl2.so:
        dl3.so (0x800e00000)
        st1.so (0x800f01000)
dl3.so:
        st1.so (0x800e00000)
env LD_LIBRARY_PATH=. ./main
dlopen/dlsym error: Undefined symbol "test_dl2"
Test 1 FAILED!!!

The dlopen() function is OK
Test 2 PASSED!!!

-----------------------

------- AFTER --------
%make test
env LD_LIBRARY_PATH=. ldd main st1.so dl1.so dl2.so dl3.so
main:
        libc.so.7 => /lib/libc.so.7 (0x800634000)
st1.so:
dl1.so:
        dl2.so (0x800e00000)
        dl3.so (0x800f01000)
        st1.so (0x801002000)
dl2.so:
        dl3.so (0x800e00000)
        st1.so (0x800f01000)
dl3.so:
        st1.so (0x800e00000)
env LD_LIBRARY_PATH=. ./main
The dlopen() function is OK
Test 1 PASSED!!!

dlopen/dlsym error: Undefined symbol "test_dl2"
Test 2 FAILED!!!

------------------------

As you can see, you fixed case 1 but broke case 2.  Can you fix that?

Thanks,

Jung-uk Kim

* PS: There were some reports that this patch has some 
performance/memory hit.  Can you confirm that, too?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609151618.31968.jkim>