libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtool--gary--1.0--patch-25


From: Gary V. Vaughan
Subject: libtool--gary--1.0--patch-25
Date: Wed, 7 Jul 2004 12:16:34 +0100 (BST)
User-agent: mailnotify/0.3

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Okay to apply?

I ask because, even though it fixes an obvious bug, it breaks
binary compatibility with libtool-1.5.x libltdl.  I think the
change only breaks loaders compatibility, and I believe there
are not yet any 3rd party loader.

Also, my next patches need to break compatibility anyway, so it
is probably a moot point.

Cheers,
        Gary.
- -- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
_________________________________________________________
This patch notification generated by tlaapply version 0.5
http://tkd.kicks-ass.net/arch/address@hidden/cvs-utils--tla--1.0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (Darwin)

iD8DBQFA69uSFRMICSmD1gYRAlBfAJ9bmu+KwU92eFSDXoKwsD/SVwNPzQCfWvBo
vNJPxmMRyMQob5GjInLmpfQ=
=DyEY
-----END PGP SIGNATURE-----
* looking for address@hidden/libtool--gary--1.0--patch-24 to compare with
* comparing to address@hidden/libtool--gary--1.0--patch-24
M  ChangeLog
M  NEWS
M  doc/libtool.texi
M  libltdl/ltdl.c
M  libltdl/ltdl.h
M  libltdl/loader-loadlibrary.c

* modified files

Index: Changelog
from  Gary V. Vaughan  <address@hidden>

        * libltdl/ltdl.h (lt_dlinfo): Move private module field to here...
        * libltdl/ltdl.c (lt_dlhandle_struct): ...from here.  Changed all
        callers.
        * libltdl/loader-loadlibrary.c (sys_wll_open): Use new inteface to
        scan loaded handle->info.module fields for previously loaded
        modules.
        * doc/libtool.texi (User defined module data): Document changes to
        the interface.
        * NEWS: Updated.
        Reported by Chuck Wilson <address@hidden>

--- orig/NEWS
+++ mod/NEWS
@@ -46,6 +46,7 @@
   The symbols are deprecated but exported for backwards compatibility.
 * libltdl no longer uses lt_dlmalloc, lt_dlrealloc and lt_dlfree.  The symbols
   are still exported for backwards compatibility.
+* The lt_dlinfo struct has a new module field that can be used by dlloaders.
 * libltdl no longer supports pre-c89 compilers.  Some of the pre89 portability
   functions had compile time bugs in them anyway, so you guys can't have been
   using it :-)


--- orig/doc/libtool.texi
+++ mod/doc/libtool.texi
@@ -3329,14 +3329,17 @@
 maintained by libltdl is available to the user, in the form of this
 structure:
 
address@hidden {Type} {struct} lt_dlinfo @{ @w{char address@hidden;} @w{char 
address@hidden;} @w{int @var{ref_count};} @}
address@hidden {Type} {struct} lt_dlinfo @{ @w{char address@hidden;} @w{char 
address@hidden;} @w{int @var{ref_count};} @w{lt_module 
@var{module};address@hidden
 @code{lt_dlinfo} is used to store information about a module.
 The @var{filename} attribute is a null-terminated character string of
 the real module file name.  If the module is a libtool module then
 @var{name} is its module name (e.g. @code{"libfoo"} for
 @code{"dir/libfoo.la"}), otherwise it is set to @code{NULL}.  The
 @var{ref_count} attribute is a reference counter that describes how
-often the same module is currently loaded.
+often the same module is currently loaded. @var{module} is the
+dlloader's internal handle for the native module, and can be used, for
+example, by a loader to check whether @var{module} has already been
+loaded to save loading it again.
 @end deftypefn
 
 The following function will return a pointer to libltdl's internal copy


--- orig/libltdl/loader-loadlibrary.c
+++ mod/libltdl/loader-loadlibrary.c
@@ -38,7 +38,7 @@
 static lt_module
 sys_wll_open (lt_user_data loader_data, const char *filename)
 {
-  lt_dlhandle  cur;
+  lt_dlhandle  cur        = 0;
   lt_module    module     = 0;
   const char   *errormsg   = 0;
   char        *searchname = 0;
@@ -92,21 +92,19 @@
      We check whether LoadLibrary is returning a handle to
      an already loaded module, and simulate failure if we
      find one. */
-  cur = handles;
-  while (cur)
+  while (cur = lt_dlhandle_next (cur))
     {
-      if (!cur->module)
+      const lt_dlinfo *info = lt_dlgetinfo (cur);
+      if (!info->module)
        {
          cur = 0;
          break;
        }
 
-      if (cur->module == module)
+      if (info->module == module)
        {
          break;
        }
-
-      cur = cur->next;
   }
 
   if (cur || !module)


--- orig/libltdl/ltdl.c
+++ mod/libltdl/ltdl.c
@@ -91,7 +91,6 @@
   lt_dlinfo            info;
   int                  depcount;       /* number of dependencies */
   lt_dlhandle         *deplibs;        /* dependencies */
-  lt_module            module;         /* system module handle */
   void *               system;         /* system specific data */
   lt_caller_data       *caller_data;   /* per caller associated data */
   int                  flags;          /* various boolean stats */
@@ -404,9 +403,9 @@
     {
       lt_user_data data = loader->dlloader_data;
 
-      cur->module = loader->module_open (data, filename);
+      cur->info.module = loader->module_open (data, filename);
 
-      if (cur->module != 0)
+      if (cur->info.module != 0)
        {
          break;
        }
@@ -1712,7 +1711,7 @@
          handles = handle->next;
        }
 
-      errors += handle->loader->module_close (data, handle->module);
+      errors += handle->loader->module_close (data, handle->info.module);
       errors += unload_deplibs(handle);
 
       /* It is up to the callers to free the data itself.  */
@@ -1795,7 +1794,7 @@
       strcat(sym, symbol);
 
       /* try "modulename_LTX_symbol" */
-      address = handle->loader->find_sym (data, handle->module, sym);
+      address = handle->loader->find_sym (data, handle->info.module, sym);
       if (address)
        {
          if (sym != lsym)
@@ -1818,7 +1817,7 @@
       strcpy(sym, symbol);
     }
 
-  address = handle->loader->find_sym (data, handle->module, sym);
+  address = handle->loader->find_sym (data, handle->info.module, sym);
   if (sym != lsym)
     {
       FREE (sym);


--- orig/libltdl/ltdl.h
+++ mod/libltdl/ltdl.h
@@ -1,5 +1,5 @@
 /* ltdl.h -- generic dlopen functions
-   Copyright (C) 1998-2000 Free Software Foundation, Inc.
+   Copyright (C) 1998-2000, 2004 Free Software Foundation, Inc.
    Originally by Thomas Tanner <address@hidden>
 
    NOTE: The canonical source of this file is maintained with the
@@ -32,6 +32,7 @@
 
 #include <libltdl/lt_system.h>
 #include <libltdl/lt_error.h>
+#include <libltdl/lt_dlloader.h>
 
 LT_BEGIN_C_DECLS
 
@@ -101,10 +102,11 @@
 
 /* Read only information pertaining to a loaded module. */
 typedef        struct {
-  char *filename;              /* file name */
-  char *name;                  /* module name */
-  int  ref_count;              /* number of times lt_dlopened minus
+  char *       filename;       /* file name */
+  char *       name;           /* module name */
+  int          ref_count;      /* number of times lt_dlopened minus
                                   number of times lt_dlclosed. */
+  lt_module    module;         /* system module handle */
 } lt_dlinfo;
 
 LT_SCOPE const lt_dlinfo *lt_dlgetinfo     (lt_dlhandle handle);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]