cvs commit: src/libexec/rtld-elf rtld.c

Jung-uk Kim jkim at FreeBSD.org
Fri Sep 15 13:18:50 PDT 2006


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?


More information about the cvs-all mailing list