Nick Hudson | 6 Aug 2003 23:55
Picon

dlsym RTLD_NEXT fix

dlsym(RTLD_NEXT,...) is currently broken. The reason is dlsym uses 
__builtin_return_address(0) to determine the caller's shared object, but the 
call is done via the dlsym stub in either crt0 or libc.

The attached fix is based on how FreeBSD ld.so resolves the dlsym and friends 
symbols directly to the ld.so versions. This solution has a number of 
benefits including

	- backwards compatibility maintained and existing binaries are fixed.
	- __mainprog_obj can be removed from crt0.o
	- we do the same thing as FreeBSD

OK to commit?

Nick

Attachment (dlsym.diff): text/x-diff, 8 KiB

Gmane