summaryrefslogtreecommitdiffstats
path: root/src/usr/module_init.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/module_init.C')
-rw-r--r--src/usr/module_init.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/usr/module_init.C b/src/usr/module_init.C
index 93c3f35a7..9a652381e 100644
--- a/src/usr/module_init.C
+++ b/src/usr/module_init.C
@@ -1,3 +1,8 @@
+void call_dtors(void * i_dso_handle);
+
+// This identifies the module
+void* __dso_handle = (void*) &__dso_handle;
+
extern "C"
void _init(void*)
{
@@ -11,3 +16,12 @@ void _init(void*)
ctors++;
}
}
+
+extern "C"
+void _fini(void)
+{
+ call_dtors(__dso_handle);
+}
+
+
+
OpenPOWER on IntegriCloud