On Fri, Mar 19, 2010 at 7:28 AM, Mark Bucciarelli <mkb...@gmail.com> wrote:
> On Thu, Mar 18, 2010 at 12:59 PM, Mark Bucciarelli <mkb...@gmail.com> wrote:
>>
>> How do I get the symbolic links generated
>> from .so.<version> to .so?
>>
>
> What I've learned:
>
>  * If my test code is right (see below), dlopen("libbat.so")
>    and dlopen("/usr/local/lib/libbat.so.1.34") do the
>    same thing on OpenBSD.
>
>  * library_names_spec determines what symbolic links
>    libtool makes, and OpenBSD and Linux have different
>    values for this variable.
>
>   * a similar topic came up on this list five years ago [1]
>
> So, it seems to me the correct approach is to patch
> monetdb to skip the call to open() and let dlopen()
> do it's thing.
>
> Does this make sense?  (Dynamic loading is new
> to me.)
>
> I'll ping upstream to ask why they call open() before
> calling dlopen().  I can't think of what value it adds.
>
> Thanks,
>
> m
>
> [1] http://www.mail-archive.com/ports@openbsd.org/msg02600.html
>
> #include <dlfcn.h>
> #include <stdio.h>
>
> int
> main(void)
> {
>        void    *handle;
>        char    *fns[] = {
>                        "libbat.so",
>                        "/usr/local/lib/libbat.so.1.34",
>                        "libbat.so.1.34",
>                        "libbat.so.1",
>                        0
>                };
>        char    **fn;
>
>        for (fn = fns; *fn; fn++) {
>                fprintf(stderr, "handle = %p for %s\n", dlopen(*fn,
> RTLD_NOW), *fn);
>                dlclose(handle);
                 ^^^^^^^^^^^^^^^^

this probably crashes: use of handle without initialization.


>        }
>        return 0;
> }
>
>

Reply via email to