Shared Libraries

Guy Harris guy at auspex.auspex.com
Wed Nov 22 06:27:50 AEST 1989


I went back and checked the paper "Shared Libraries in SunOS" in the
Summer 1987 USENIX proceedings, which gives some details on how the
SunOS 4.x shared library mechanism works.  It's worth reading for
anybody interested in SunOS 4.x or System V Release 4 dynamic linking. 
In particular, it answers a question about "ld.so" left unanswered by my
previous posting:

>It knows where "ld.so" lives, and how to map it in, etc..  It may assume
>that "ld.so" is position-independent code, so that it doesn't have to
>relocate it (it is position-independent code, but I don't remember any
>more whether the "crt0" code could relocate it if it weren't); "ld.so"
>contains enough code of its own so that it doesn't depend on "libc" or
>anything like that. 

In fact, "ld.so" may require relocation, but only "very simple forms of
relocation" that can be handled by a bootstrap routine in "ld.so"
itself.  The paper discusses this briefly in section 6.2 in which it
describes how "ld.so" itself is built.



More information about the Comp.unix.wizards mailing list