Date: Tue, 25 Jul 2000 21:24:41 -0700 (PDT) From: John Polstra <jdp@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/libexec/rtld-elf rtld.c rtld.h Message-ID: <200007260424.VAA41799@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
jdp 2000/07/25 21:24:41 PDT Modified files: libexec/rtld-elf rtld.c rtld.h Log: Revamp the code that calls shared libraries' init and fini functions. Formerly the init functions were called in the opposite of the order in which libraries were loaded, and libraries were loaded according to a breadth-first traversal of the dependency graph. That ordering came from SVR4.0, and it was easy to implement but not always sensible. Now we do a depth-first walk over the dependency graph and call the init functions in an order such that each shared object's needed objects are initialized before the shared object itself. At the same time we build a list of finalization (fini) functions in the opposite order, to guarantee correct C++ destructor ordering whenever possible. (It may not be possible if dlopen and dlclose are used in strange ways, but we come as close as one can come.) The need for this renovation has become apparent as more programs have started using multithreading. The multithreaded C library libc_r requires initialization, whereas the standard libc does not. Since virtually every other object depends on the C library, it is important that it get initialized first. Revision Changes Path 1.47 +184 -99 src/libexec/rtld-elf/rtld.c 1.19 +3 -9 src/libexec/rtld-elf/rtld.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200007260424.VAA41799>