From owner-freebsd-current@FreeBSD.ORG Thu Feb 12 02:53:13 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4675316A4CE for ; Thu, 12 Feb 2004 02:53:13 -0800 (PST) Received: from mgate15.so-net.ne.jp (mgate15.so-net.ne.jp [210.139.254.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id D310C43D1D for ; Thu, 12 Feb 2004 02:53:12 -0800 (PST) (envelope-from fuyuki@nigredo.org) Received: from mail.dg8.so-net.ne.jp (mspool12.so-net.ne.jp [210.139.248.12]) by mgate15.so-net.ne.jp with ESMTP id i1CArBb04913 for ; Thu, 12 Feb 2004 19:53:11 +0900 (JST) Received: from ns.nigredo.org (p6242d5.spprac00.ap.so-net.ne.jp [219.98.66.213]) by mail.dg8.so-net.ne.jp with ESMTP id i1CAr9E00513 for ; Thu, 12 Feb 2004 19:53:10 +0900 (JST) Received: from ns.nigredo.org (localhost [IPv6:::1]) by ns.nigredo.org (Postfix) with ESMTP id 6FC0E20A5 for ; Thu, 12 Feb 2004 19:53:09 +0900 (JST) Date: Thu, 12 Feb 2004 19:53:09 +0900 Message-ID: <86n07oa7sa.wl%fuyuki@nigredo.org> From: Kimura Fuyuki To: freebsd-current@freebsd.org User-Agent: Wanderlust/2.10.1 (Watching The Wheels) Emacs/21.3 Mule/5.0 (SAKAKI) X-Public-Key: http://www.nigredo.org/fuyuki/public.key X-Fingerprint: 8D68 1138 1A85 8556 C6A9 274B 2C72 2E56 3AF7 3D89 MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Subject: relocator oddity? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2004 10:53:13 -0000 Someone please run the test below and tell me why dltest[12] show the different results on my 5.2.1-RC2 box. At least NetBSD 1.5.2 and some sort of Linux pass the test. #!/bin/sh cat <<[EOF] >shared.c double sin(double d) {return 9;} double faked_sin(double d) {return sin(d);} [EOF] cat <<[EOF] >dltest.c #include #include int main(void) { void *h; double (*faked_sin)(double); h = dlopen("./shared.so", RTLD_LAZY); faked_sin = dlsym(h, "faked_sin"); printf("%f\n", faked_sin(0)); } [EOF] cc -shared -o shared.so shared.c cc dltest.c -o dltest1 ./dltest1 >result1 cc dltest.c -o dltest2 -lm ./dltest2 >result2 if diff result1 result2 >/dev/null; then echo "You are very talented." else echo "Please tell me what's happening!" fi -- fuyuki