> Modified Files:
> Makefile.inc devname.c err.c getbsize.c getnetgrent.c
> initgroups.c
> Added Files:
> __err.c
> Log Message:
> - Changed all internal libc references of {v,}err{x,} and {v,}warn{x,} to
> __{v,}err{x,} and __{v,}warn{x,}
> - moved err.c to __err.c and added err.c which contains weak references for
> the above functions.
> - Reordered the functions in __err.c to avoid redeclarations and changed
> the varargs declarations to conform with the K&R style.
These changes are not consistant with my not-yet-published strategy on
how we should handle weak/indirect references. Of course Christos had
no way to know that, and the errors needed to be fixed so people could
compile the source.
Based on responses received from my recent posting on tech-userlevel,
these are my recommendations on how we should procede:
1. NetBSD needs real weak references. This can be accomplished
by merging the current gas/ld a.out weak reference support
into NetBSD, or by merging NetBSD's shared library support
into gas/ld. Both strategies have their own advantages
and disadvantages. I'll address them in a future message
because I don't want to cloud the immediate issues.
As the bug that this fix demonstrates, we sometimes will not be in a
position to wait for the real weak references. To work around this
deficiency, we will use the indirect reference support in NetBSD's
assembler and linker.
2. All functions will remain in their original containing files
(files will not be renamed).
3. All functions that need to be namespace protected will be
renamed to have a single leading underscore. There are some
functions in the NetBSD C library that still have double
underscores. This was caused by me missreading a section
of the C standard, and will be fixed soon.
Advantages of a single underscore include short
identifiers, and consistancy with the Svr4 ABI (programs like
autoconf search for the single underscore forms of identifiers).
4. Ideally, object files containing directives to will be generated
programmatically from make files. Until that mechanism is
in place, the mappings will be stored in "stub" files named
by catenating a single underscore and the function name.
When we get real weak symbols, we will:
5. Remove any remaining "stub" files and makefile junk, and add
weak symbol entries directly to the function's source files
as follows:
#pragma weak foo=_foo
--jtc