Bug in dlfunc with RTLD_NEXT RTLD_SELF etc

Peter O'Gorman peter at pogma.com
Sat May 24 22:28:53 PDT 2003

Sorry, I do not have a freebsd machine, so I can not use the send-pr 
program to send this.

dlfunc is implememted in libc/gen and simply calls dlsym, this works 
fine when doing normal lookups, but is broken for RTLD_{NEXT,SELF}.

http://www.pogma.com/fink/dltest.tar should demonstrate the problem ( I 
am not sure that this list takes attachments).

One solution would be to move dlfunc to libexec/rtld-elf (or whatever 
that is called), rename dlsym to something else (e.g. dlsym_real) make 
it static,change the __builtin_return(0) to __builtin_return(1), make a 
new dlsym function which calls dlsym_real (that way dlsym_real is 
always called with one level of indirection from both dlsym and dlfunc 

But, you guys can fix it however you please :)

I was just peeking at your source code looking for idea's for 
opendarwin.org's dlcompat project, Shantonu Sen - ssen at opendarwin 
dot org - kindly ran the test code for me on his freebsd 5.0 machine.


More information about the freebsd-bugs mailing list