libtool-patches
[Top][All Lists]
Advanced

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

Re: [PATCH 370 bis] Implement lt_dlopening of only preloaded modules.


From: Ralf Wildenhues
Subject: Re: [PATCH 370 bis] Implement lt_dlopening of only preloaded modules.
Date: Sat, 16 Aug 2008 12:25:38 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Gary,

late second round of review:

* Gary V. Vaughan wrote on Wed, May 07, 2008 at 10:32:13PM CEST:
> * libltdl/m4/ltdl.m4 (LTDL_INIT): Check for a libltdl that
> provides lt_dladvise_preopen when deciding if installed libltdl
> is 'new enough'.
> * libltdl/libltdl/lt__private.h (lt__advise): Add a new
> is_preload flag.
> * libltdl/ltdl.c (lt_dladvise_preload): New api call to set it.
> (try_dlopen): If it is set, and the search of preloaded modules
> didn't return a match, don't bother searching the filesystem.
> * libltdl/ltdl.h (lt_dladvise_preload): Declare it.
> * doc/libtool.texi (Libltdl Interface): Document it.
> * tests/lt_dladvise.at: Test it (and incidentally add some test
> coverage for `libtool -dlpreopen').
> * NEWS: Announce it.

> --- a/libltdl/libltdl/lt__private.h
> +++ b/libltdl/libltdl/lt__private.h
> @@ -126,6 +126,7 @@ struct lt__advise {
>                                  subsequently loaded modules.  */
>    unsigned int       is_symlocal:1;  /* module symbols are only available
>                                  locally. */
> +  unsigned int       try_preload_only:1;/* only preloaded modules will be 
> tried. */
>  };
>  
>  /* --- ERROR HANDLING --- */
> diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
> index a89c6bb..5a26565 100644
> --- a/libltdl/ltdl.c
> +++ b/libltdl/ltdl.c
> @@ -1129,6 +1129,7 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, 
> const char *ext,
>           lt_dladvise advise)
>  {
>    const char *       saved_error     = 0;
> +  char *     archive_name    = 0;
>    char *     canonical       = 0;
>    char *     base_name       = 0;
>    char *     dir             = 0;
> @@ -1257,16 +1258,21 @@ try_dlopen (lt_dlhandle *phandle, const char 
> *filename, const char *ext,
>  
>        if (vtable)
>       {
> +       archive_name = MALLOC (char, LT_STRLEN (name) + 3);

This should probably be
  LT_STRLEN (name) + LT_STRLEN (".a") + 1

except that...

> -       if (tryall_dlopen (&newhandle, attempt, advise, vtable) == 0)
> +       /* Preloaded modules are always named according to their old
> +          archive name.  */
> +       sprintf (archive_name, "%s.a", name);

... the archive name could also be NAME.lib.

The testsuite addition should ideally also ensure that a non-preloaded
module cannot be opened with the preload flag set, no?

None of these issues are regressions.

Please indicate (soon!) whether you will have any resources to work on
this.  Otherwise I probably can, but I'd like to avoid stepping on your
toe or doing extra work.

Cheers,
Ralf




reply via email to

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