# HG changeset patch # User John W. Eaton # Date 1224781246 14400 # Node ID 095b3e4d64e99065bba14a14fcf849cc68a14fff # Parent 5a2e45facabe173e147283bbd2cca0864349e4e0 oct-shlib.cc: use RTLD_NOW option for dlopen diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2008-10-23 John W. Eaton + + * oct-shlib.cc (octave_dlopen_shlib::open): Use RTLD_NOW instead + of RTLD_LAZY. + 2008-10-12 Jaroslav Hajek * CSparse.cc (ComplexMatrix::expm): Improve inverse preconditioning diff --git a/liboctave/oct-shlib.cc b/liboctave/oct-shlib.cc --- a/liboctave/oct-shlib.cc +++ b/liboctave/oct-shlib.cc @@ -243,8 +243,12 @@ int flags = 0; -#if defined (RTLD_LAZY) - flags |= RTLD_LAZY; + // Use RTLD_NOW to resolve all symbols before dlopen returns. + // By using this option, dlopen will detect errors and Octave + // won't exit if there are unresolved symbols in the file we are + // loading, and we may even get a useful diagnostic. +#if defined (RTLD_NOW) + flags |= RTLD_NOW; #endif #if defined (RTLD_GLOBAL)