atom feed17 messages in org.freebsd.freebsd-currentWeak symbols (Was: World breakage in ...
FromSent OnAttachments
John PolstraOct 13, 1999 2:36 pm 
Doug RabsonOct 14, 1999 1:08 am 
Marcel MoolenaarOct 14, 1999 3:16 am 
Wilko BulteOct 14, 1999 9:45 am 
Kenneth Wayne CulverOct 14, 1999 12:09 pm 
Daniel EischenOct 14, 1999 12:20 pm 
John PolstraOct 14, 1999 2:06 pm 
John BirrellOct 14, 1999 2:19 pm 
Daniel EischenOct 14, 1999 2:34 pm 
John PolstraOct 14, 1999 2:44 pm 
John BirrellOct 14, 1999 2:53 pm 
Daniel EischenOct 14, 1999 3:25 pm 
David O'BrienOct 15, 1999 8:38 am 
Wilko BulteOct 15, 1999 11:09 am 
John BirrellOct 15, 1999 3:07 pm 
pa...@phoenix.volant.orgOct 15, 1999 3:23 pm 
John PolstraOct 17, 1999 10:16 am 
Subject:Weak symbols (Was: World breakage in libc_r?)
From:John Birrell (jb@cimlogic.com.au)
Date:Oct 15, 1999 3:07:01 pm
List:org.freebsd.freebsd-current

On Fri, Oct 15, 1999 at 08:09:57PM +0200, Wilko Bulte wrote:

Sheer curiosity and most likely a somewhat dim question:

what the h* is a weak versus a strong symbol?

A weak symbol is like an alias for another (strong) symbol. The linker will link to strong symbols first, then, for any unresolved references, it will try to resolve against the weak symbols before going on to the next library. Weak symbols are a good way to hide things in order to stop polluting the name space. But they can cause problems too.

Our use of weak symbols in libc is incomplete. Although syscalls like read() have _read() as the strong symbol and read() as the weak one, we continue to call read() in other areas of libc. This means that a user can create their own read() function and they won't get a clash when they link against libc, but other functions in libc that really want to call the _read() syscall will call the user's read() function instead. That's broken. We really need to change libc in the way that NetBSD did with their namespace.h stuff. This ensures that the internals of libc call the hidden names, not the weakly exported ones.

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