Linker answers

smb at att.arpa smb at att.arpa
Sat Feb 4 00:04:08 AEST 1989


The linker processes evrerything sequentially.  Normally, there's a
startup file (supplied invisibly by cc), all of the .o files you mention,
some set of libraries you mention, and then libc.a.  Thus, if there's a
routine named 'select' in the .o files, it will be included, and will be
used to resolve all references to any call to select() anywhere in the
program.  When a library file is encountered, it too is scanned
sequentially; here, however, routines are selected only if they resolve an
outstanding unresolved reference.  Libraries are rescanned until no
routines from a library are selected; following that, the next library is
scanned.  Thus, the version of select() from libsunwindow.a will be used
in preference to the one in libc.a.  Fortunately, it's carefully written
to perform the vanilla functions as well; note the presence of the routine
sys_select() in that library.



More information about the Comp.sys.sun mailing list