diff --git a/src/os/unix/mod.rs b/src/os/unix/mod.rs index 83657a9..2adb966 100644 --- a/src/os/unix/mod.rs +++ b/src/os/unix/mod.rs @@ -103,12 +103,12 @@ impl Library { /// a file. Otherwise, platform-specific algorithms are employed to find a library with a /// matching file name. /// - /// This is equivalent to [`Library::open`]`(filename, RTLD_NOW)`. + /// This is equivalent to [`Library::open`]`(filename, RTLD_LAZY | RTLD_LOCAL)`. /// /// [path separator]: std::path::MAIN_SEPARATOR #[inline] pub fn new>(filename: P) -> Result { - Library::open(Some(filename), RTLD_NOW) + Library::open(Some(filename), RTLD_LAZY | RTLD_LOCAL) } /// Eagerly load the `Library` representing the current executable. @@ -124,12 +124,12 @@ impl Library { /// Note that behaviour of `Library` loaded with this method is different from /// Libraries loaded with [`os::windows::Library::this`]. /// - /// This is equivalent to [`Library::open`]`(None, RTLD_NOW)`. + /// This is equivalent to [`Library::open`]`(None, RTLD_LAZY | RTLD_LOCAL)`. /// /// [`os::windows::Library::this`]: crate::os::windows::Library::this #[inline] pub fn this() -> Library { - Library::open(None::<&OsStr>, RTLD_NOW).expect("this should never fail") + Library::open(None::<&OsStr>, RTLD_LAZY | RTLD_LOCAL).expect("this should never fail") } /// Find and load an executable object file (shared library).