Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jun 1998 16:51:16 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Terry Lambert <tlambert@primenet.com>, ache@FreeBSD.ORG, fenner@parc.xerox.com, current@FreeBSD.ORG
Subject:   Re: Bogus errno twiddling not by lstat... 
Message-ID:  <199806230851.QAA05964@spinner.netplex.com.au>
In-Reply-To: Your message of "Tue, 23 Jun 1998 06:29:21 %2B0800." <199806222229.GAA04192@spinner.netplex.com.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Wemm wrote:
> Terry Lambert wrote:
> > > > Since the malloc.conf file is unnecessarily being looked for in the
> > > > printf case (since ld.so already caused it to be looked for, and didn't
> > > > find it), I think the redundant call to llok for it is certainly worth
> > > > removing.
> > > 
> > > You have repeated this misinformation at least 10th times, I think. 
> > > malloc.conf looked up only on first call to malloc(). ld.so probably 
> > > call malloc() from the C library quite rare.
> > 
> > Do you remember the discussion about the __error hacks to ld.so?

No, I skipped it after the first 2000 iterations...

> > Initially when I was attempting to use weak symbols as they are
> > documented to work (but they don't), I had a number of myseterious
> > lockups on startup.
> 
> Weak and indirects are not implemented in ld.so for a.out at runtime.  The
> only place that they are implemented is in the elf ld.so and in both the
> a.out and elf ld(1).   It shouldn't be too hard to get the a.out ld.so to 
> do something sensible though for weak and/or indirect symbols.

Actually, it looks like I'm wrong.  N_INDR symbols do appear to be 
implemented in the a.out ld.so, but #pragma weak is not.  Whether it works 
or not is a good question. :-)

Note that you must use __weak_reference() to get it to have any chance of
having a hack like this work on both a.out and elf (unlike Andrey's hack to
libmytinfo).

I'm not sure that it will work well in a.out anyway because the our ld.so 
doesn't keep track of references to symbol scope properly.  The NetBSD 
a.out ld.so has got all this stuff implemented, including #pragma weak in 
a.out.

Cheers,
-Peter



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806230851.QAA05964>