From df77f62baf7cbe33ac0b236218fd3a16c824d1f7 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Tue, 2 Jul 2019 15:01:20 +0200 Subject: [PATCH] dlopen.3: Clarify that constructors are called only when library is first loaded And fix a wording error that I introduced back in 2015. Signed-off-by: Michael Kerrisk --- man3/dlopen.3 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/man3/dlopen.3 b/man3/dlopen.3 index 331d3162c4..2a32690f71 100644 --- a/man3/dlopen.3 +++ b/man3/dlopen.3 @@ -212,7 +212,7 @@ If the executable was linked with the flag "\-rdynamic" then the global symbols in the executable will also be used to resolve references in a dynamically loaded shared object. .PP -If the same shared object is loaded again with +If the same shared object is opened again with .BR dlopen (), the same object handle is returned. The dynamic linker maintains reference @@ -222,7 +222,8 @@ deallocated until has been called on it as many times as .BR dlopen () has succeeded on it. -Any initialization returns (see below) are called just once. +Constructors (see below) are called only when the library is actually loaded +into memory (i.e., when the reference count increases to 1). However, a subsequent .BR dlopen () call that loads the same shared object with -- 2.47.2