summaryrefslogtreecommitdiffstats
path: root/include/link.h
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1995-06-27 09:53:27 +0000
committerdfr <dfr@FreeBSD.org>1995-06-27 09:53:27 +0000
commit6da3ef32238f37b3b45cf709205fcff60bcbda7f (patch)
treeb2f08f6f168c7683bfcb9675e76d2b7d12267c7e /include/link.h
parente99bd397ee99a54805081daa8655d6ae246f14d0 (diff)
downloadFreeBSD-src-6da3ef32238f37b3b45cf709205fcff60bcbda7f.zip
FreeBSD-src-6da3ef32238f37b3b45cf709205fcff60bcbda7f.tar.gz
Change ld.so to correctly load dependant libraries for dlopen and unload them
on dlclose. Also correctly call constructors and destructors for libraries linked with /usr/lib/c++rt0.o. Change interpretation of dlopen manpage to call _init() rather than init() for dlopened objects. Change c++rt0.o to avoid using atexit to call destructors, allowing dlclose to call destructors when an object is unloaded. Change interface between crt0 and ld.so to allow crt0 to call a function on exit to call destructors for shared libraries explicitly. These changes are backwards compatible. Old binaries will work with the new ld.so and new binaries will work with the old ld.so. A version number has been introduced in the crt0-ld.so interface to allow for future changes. Reviewed by: GAWollman, Craig Struble <cstruble@singularity.bevc.blacksburg.va.us>
Diffstat (limited to 'include/link.h')
-rw-r--r--include/link.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/link.h b/include/link.h
index 38c9c40..15277a7 100644
--- a/include/link.h
+++ b/include/link.h
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: link.h,v 1.3 1995/02/07 13:26:39 jkh Exp $
+ * $Id: link.h,v 1.4 1995/03/04 17:49:20 nate Exp $
*/
/*
@@ -163,13 +163,22 @@ struct so_debug {
};
/*
+ * Version returned to crt0 from ld.so
+ */
+#define LDSO_VERSION_NONE 0 /* FreeBSD2.0, 2.0.5 */
+#define LDSO_VERSION_HAS_DLEXIT 1 /* includes dlexit in ld_entry */
+
+/*
* Entry points into ld.so - user interface to the run-time linker.
+ * Entries are valid for the given version numbers returned by ld.so
+ * to crt0.
*/
struct ld_entry {
- void *(*dlopen) __P((char *, int));
- int (*dlclose) __P((void *));
- void *(*dlsym) __P((void *, char *));
- char *(*dlerror) __P((void));
+ void *(*dlopen) __P((char *, int)); /* NONE */
+ int (*dlclose) __P((void *)); /* NONE */
+ void *(*dlsym) __P((void *, char *)); /* NONE */
+ char *(*dlerror) __P((void)); /* NONE */
+ void (*dlexit) __P((void)); /* HAS_DLEXIT */
};
/*
@@ -246,7 +255,6 @@ struct crt_ldso {
#define CRT_VERSION_BSD_3 3
#define CRT_VERSION_BSD_4 4
-
/*
* Maximum number of recognized shared object version numbers.
*/
OpenPOWER on IntegriCloud