summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/rtld.h
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>2000-01-09 21:13:48 +0000
committerjdp <jdp@FreeBSD.org>2000-01-09 21:13:48 +0000
commit4baa442de26d9c9926ae2dca6af2e8aedbf1ce3f (patch)
treef3343da02a9a1e06ca8a7d9cd66683be2ce32b80 /libexec/rtld-elf/rtld.h
parentfe42017b7b8d828d2873029e711cac80e5026145 (diff)
downloadFreeBSD-src-4baa442de26d9c9926ae2dca6af2e8aedbf1ce3f.zip
FreeBSD-src-4baa442de26d9c9926ae2dca6af2e8aedbf1ce3f.tar.gz
Revamp the mechanism for enumerating and calling shared objects'
init and fini functions. Now the code is very careful to hold no locks when calling these functions. Thus the dynamic linker cannot be re-entered with a lock already held. Remove the tolerance for recursive locking that I added in revision 1.2 of dllockinit.c. Recursive locking shouldn't happen any more. Mozilla and JDK users: I'd appreciate confirmation that things still work right (or at least the same) with these changes.
Diffstat (limited to 'libexec/rtld-elf/rtld.h')
-rw-r--r--libexec/rtld-elf/rtld.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h
index b8fcf2c..3a88547 100644
--- a/libexec/rtld-elf/rtld.h
+++ b/libexec/rtld-elf/rtld.h
@@ -1,5 +1,5 @@
/*-
- * Copyright 1996-1998 John D. Polstra.
+ * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,6 +52,7 @@ typedef unsigned char bool;
struct stat;
struct Struct_Obj_Entry;
+/* Lists of shared objects */
typedef struct Struct_Objlist_Entry {
STAILQ_ENTRY(Struct_Objlist_Entry) link;
struct Struct_Obj_Entry *obj;
@@ -59,6 +60,17 @@ typedef struct Struct_Objlist_Entry {
typedef STAILQ_HEAD(Struct_Objlist, Struct_Objlist_Entry) Objlist;
+/* Lists of init or fini functions */
+typedef void (*InitFunc)(void);
+
+typedef struct Struct_Funclist_Entry {
+ STAILQ_ENTRY(Struct_Funclist_Entry) link;
+ InitFunc func;
+} Funclist_Entry;
+
+typedef STAILQ_HEAD(Struct_Funclist, Struct_Funclist_Entry) Funclist;
+
+/* Lists of shared object dependencies */
typedef struct Struct_Needed_Entry {
struct Struct_Needed_Entry *next;
struct Struct_Obj_Entry *obj;
@@ -122,8 +134,8 @@ typedef struct Struct_Obj_Entry {
const char *rpath; /* Search path specified in object */
Needed_Entry *needed; /* Shared objects needed by this one (%) */
- void (*init)(void); /* Initialization function to call */
- void (*fini)(void); /* Termination function to call */
+ InitFunc init; /* Initialization function to call */
+ InitFunc fini; /* Termination function to call */
bool mainprog; /* True if this is the main program */
bool rtld; /* True if this is the dynamic linker */
OpenPOWER on IntegriCloud