[comp.bugs.sys5] standard I/O and exit/_exit

fnf@mcdsun.UUCP (Fred Fish) (07/08/87)

In article <374@nikhefh.UUCP> gert@nikhefh.UUCP (Gert Poletiek) writes:
>This module should be in the end of the library so the linker will encounter
>it always *after* the module containing the other initialisation of
>_cleanup.

Just so others don't fall into this same trap, this technique no longer
works with current System V linker and archiver (ld/ar).  The archiver
maintains a table of contents of global references, and the file offset
to the module that resolves them.  The linker takes the first one it
finds, ergo second and subsequent references are never seen.  The
special ordering of archive members seems to be a hack that was carried
over from the days when the linker scanned the archive sequentially looking
for unresolved symbols.

This discussion started in comp.os.minix, but is really a more global 
problem.

-Fred
-- 
= Drug tests; just say *NO*!
= Fred Fish  Motorola Computer Division, 3013 S 52nd St, Tempe, Az 85282  USA
= seismo!noao!mcdsun!fnf    (602) 438-5976