Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH8yC8n6mUFtFsp3hUbt=xcNd518JPrcuqgEwNp72r_HQwX9oQ@mail.gmail.com>
Date: Thu, 28 May 2020 15:20:46 -0400
From: Jeffrey Walton <noloader@...il.com>
To: musl@...ts.openwall.com
Subject: Re: Shared library loading

On Wed, May 27, 2020 at 2:10 PM Dmitry Samersoff <dms@...ersoff.net> wrote:
>
> > The "b" library loading works on my Ubuntu 19.10 and
> > fails on Alpine 3.11.6 with message: > dlopen failed: Error loading shared library liba.so: No such file or
> > directory (needed by /root/load-lib-sample/bin/b/libb.so)
> > Should it work on Alpine with musl libc as well?
>
> 1. You explicitly load library with a path (.../liba.so)
>
> 2. You are explicitly loading another library (.../libb.so)
>
> 3. Linker find liba.so in the appropriate section of libb.so and
> attempts to load it from syspath (LD_LIBRARY_PATH etc)
>
> 4. Linker doesn't find it. Musl return error on this step but glibc and
> BSD go further.
>
> 5. Linker compares short names of already loaded library and the
> required one
>
> 6. It matches, so Linker decides to resolve
>
> I didn't find any specification that dictates one or other behavior, so
> it could not be considered as a bug.

I believe Drepper's DSO HowTo specifies the behavior for Linux.

Also see https://www.akkadia.org/drepper/dsohowto.pdf.

Jeff

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.