From f6cd1529aced0fc440a44c3666f73e950c3e1a69 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Sat, 6 Mar 1999 20:25:04 +0000 Subject: [PATCH] * libltdl/ltdl.c (LTDL_LAZY_OR_NOW): renamed from LTDL_NOW; prefer LAZY loading because it's much faster and NOW is apparently partially broken on FreeBSD Reported by Archie Cobbs --- ChangeLog | 7 +++++++ libltdl/ltdl.c | 30 +++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb2461034..a3b2417ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1999-03-06 Alexandre Oliva + + * libltdl/ltdl.c (LTDL_LAZY_OR_NOW): renamed from LTDL_NOW; prefer + LAZY loading because it's much faster and NOW is apparently + partially broken on FreeBSD + Reported by Archie Cobbs + 1999-03-06 Alexandre Oliva * ltconfig.in (archive_expsym_cmds, solaris, without_gnu_ld): diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 2b4432730..63bb2be56 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -216,23 +216,35 @@ strrchr(str, ch) #define dlerror() unknown_error #endif -#if RTLD_GLOBAL +#ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else -# if DL_GLOBAL +# ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif -#if RTLD_NOW -# define LTDL_NOW RTLD_NOW -#else -# if DL_NOW -# define LTDL_NOW DL_NOW +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LTDL_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LTDL_LAZY_OR_NOW RTLD_LAZY # else -# define LTDL_NOW 0 +# ifdef DL_LAZY +# define LTDL_LAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LTDL_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LTDL_LAZY_OR_NOW DL_NOW +# else +# define LTDL_LAZY_OR_NOW 0 +# endif +# endif +# endif # endif #endif @@ -253,7 +265,7 @@ dl_open (handle, filename) lt_dlhandle handle; const char *filename; { - handle->handle = dlopen(filename, LTDL_GLOBAL | LTDL_NOW); + handle->handle = dlopen(filename, LTDL_GLOBAL | LTDL_LAZY_OR_NOW); if (!handle->handle) { last_error = dlerror(); return 1; -- 2.47.2