From owner-freebsd-current Thu May 21 11:00:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA24012 for freebsd-current-outgoing; Thu, 21 May 1998 11:00:23 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp02.primenet.com (daemon@smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA23996 for ; Thu, 21 May 1998 11:00:14 -0700 (PDT) (envelope-from tlambert@usr01.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id LAA24545; Thu, 21 May 1998 11:00:10 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp02.primenet.com, id smtpd024505; Thu May 21 11:00:04 1998 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id KAA18688; Thu, 21 May 1998 10:42:41 -0700 (MST) From: Terry Lambert Message-Id: <199805211742.KAA18688@usr01.primenet.com> Subject: Re: Fix for undefined "__error" and discussion of shared object versioning To: syssgm@dtir.qld.gov.au (Stephen McKay) Date: Thu, 21 May 1998 17:42:41 +0000 (GMT) Cc: tlambert@primenet.com, freebsd-current@FreeBSD.ORG, syssgm@dtir.qld.gov.au In-Reply-To: <199805210515.PAA07271@troll.dtir.qld.gov.au> from "Stephen McKay" at May 21, 98 03:15:44 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >Use the real symbol names. I don't know why what you are doing won't > >work, but it's *not* what I'm doing, wo it really doesn't matter > >why it doesn't work because it's the wrong thing to do anyway. > > All I did was add a variable (fake_used) that is incremented every time > the __error stand-in (called ___error) is called. In other words, I > instrumented your solution, nothing more. The instrumentation shows > that ___error is called when we expect it not to be called. This is > why I claim that this fix doesn't work. You renamed the symbol, and didn't reacquire it from a subsequently loaded shared library. Because libc (or libc_r) is loaded before the libraries which depend on its symbols, its weak symbols should take precedence. Loading should occur in reverse link order. > To show it really working (if it does work) would require multiple > threads that have different errno values. Showing one thread having > a single errno value is not sufficient. I don't understand your claim. Have you looked at: /usr/src/lib/libc_r/sys/__error.c /usr/src/lib/libc_r/uthread/uthread_seterrno.c ??? The initial thread gets the address of the global "errno"; subsequent threads get the address of a thread specific errno: &_thread_run->error Which is derived from the per thread context structure for the running thread. I *EXPECT* the the stand-in will be called by programs that are *bogusly* NOT relinked against libc, as they should be. For programs *already* linked against libc_r instead of libc, or linked against the new libc, I *EXPECT* the standin to *NEVER* be called. If your program is already linked against libc_r, then *BY DEFINITION*, you aren't having the "undefined __error()" problem. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message