| From | Sent On | Attachments |
|---|---|---|
| John Polstra | Oct 13, 1999 2:36 pm | |
| Doug Rabson | Oct 14, 1999 1:08 am | |
| Marcel Moolenaar | Oct 14, 1999 3:16 am | |
| Wilko Bulte | Oct 14, 1999 9:45 am | |
| Kenneth Wayne Culver | Oct 14, 1999 12:09 pm | |
| Daniel Eischen | Oct 14, 1999 12:20 pm | |
| John Polstra | Oct 14, 1999 2:06 pm | |
| John Birrell | Oct 14, 1999 2:19 pm | |
| Daniel Eischen | Oct 14, 1999 2:34 pm | |
| John Polstra | Oct 14, 1999 2:44 pm | |
| John Birrell | Oct 14, 1999 2:53 pm | |
| Daniel Eischen | Oct 14, 1999 3:25 pm | |
| David O'Brien | Oct 15, 1999 8:38 am | |
| Wilko Bulte | Oct 15, 1999 11:09 am | |
| John Birrell | Oct 15, 1999 3:07 pm | |
| pa...@phoenix.volant.org | Oct 15, 1999 3:23 pm | |
| John Polstra | Oct 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.
-- John Birrell - jb...@cimlogic.com.au; jb...@freebsd.org http://www.cimlogic.com.au/ john...@opendirectory.com.au
To Unsubscribe: send mail to majo...@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message





