From owner-freebsd-hackers Tue May 16 9:37:48 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 6ABDD37B54F for ; Tue, 16 May 2000 09:37:46 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.3/8.9.3) with ESMTP id JAA19716; Tue, 16 May 2000 09:37:45 -0700 (PDT) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.3/8.9.1) id JAA82865; Tue, 16 May 2000 09:37:44 -0700 (PDT) (envelope-from jdp@polstra.com) Date: Tue, 16 May 2000 09:37:44 -0700 (PDT) Message-Id: <200005161637.JAA82865@vashon.polstra.com> To: n@nectar.com Subject: Re: need to borrow a clue re: rtld In-Reply-To: <20000516002513.A65118@bone.nectar.com> References: <20000516002513.A65118@bone.nectar.com> Organization: Polstra & Co., Seattle, WA Cc: hackers@freebsd.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <20000516002513.A65118@bone.nectar.com>, Jacques A . Vidrine wrote: > Messing about with Dante (the SOCKS5 replacement), I've encountered > some difficulty with run-time linking that I don't understand. > > In brief: > > $ env LD_PRELOAD=libdsocks.so telnet # works > $ env LD_PRELOAD=libdsocks.so xchat # undefined symbol '_gethostbyname' > $ env LD_PRELOAD=libc.so:libdsocks.so xchat # works Which version of FreeBSD? If you have time, please rebuild "src/libexec/rtld-elf" with DEBUG_FLAGS=-DDEBUG. Make a copy of your existing "/usr/libexec/ld-elf.so.1" and then install the debugging version. Run your first test case like this: script Log.1 env LD_DEBUG=1 LD_PRELOAD=libdsocks.so telnet (exit telnet and get out of "script") and likewise for the failing test case (with a different filename for script, of course). Send the output to me and I'll try to figure out what's happening. After you're done, you should restore your original (non-debugging) rtld. It's more efficient and also probably more secure. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message