[Talk] State of dynamic linking in various platforms...

Luke Mewburn lukem at wasabisystems.com
Thu Aug 22 14:24:53 EST 2002


Hi.

I'm trying to determine the prevelance of dynamic linking in various
recent UNIX operating systems.

I'm aware of the following systems:

	Solaris	
		Dynamic linked "world" (/usr/lib/*.so and /usr/lib/ld.so),
		with some exceptions including:
			/usr/bin/sync
			/sbin/{autopush,fdisk,jsh,mount,sh,soconfig,\
				sync,umount,uname}
			/usr/sbin/{cp,ln,mv,rcp,tar}

		Some of the other stuff in /sbin is only linked
		against /etc/lib/libdl.so.1 (versus /usr/lib/*).

		Obviously if /usr isn't available or /usr/lib is corrupt,
		it's hard to recover the system with resorting to boot
		media.

	NetBSD
		Statically linked /bin and /sbin. Rest dynamically linked
		against /usr/lib (with the linker in /usr/libexec/ld.elf_so).

	FreeBSD
		Similar to NetBSD ???

	OpenBSD
		Similar to NetBSD ???

	Linux
		Dynamic linked "world" against /lib and /usr/lib ???


I'm working on a solution to making NetBSD have a dynamically linked
"world", to solve a variety of problems (such as dlopen(3) not working
for programs in /bin and /sbin because they're statically linked), but
there's been some reasonable objections in the past because people
have been "burnt" on Solaris and Linux.

My solution is to provide /rescue, which contains a "crunched" copy of
the files from /sbin and /bin statically linked, and switch /bin and
/sbin to dynamic linking, with certain libraries moved from /usr/lib
to /lib and the dynamic linker moved from /usr/libexec to /lib.
(We have to retain existing functionality of not requiring /usr for
the first stages of the boot process).
Recovery in the case of failure of /lib/* is to boot to single user
mode with /rescue/sh as the shell, and prepend /rescue to the PATH.

I'm curious to other peoples experiences with fully dynamic systems,
and thoughts on my solution.

Luke.



More information about the Talk mailing list