From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25317 invoked from network); 28 May 2020 19:21:21 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 28 May 2020 19:21:21 -0000 Received: (qmail 17686 invoked by uid 550); 28 May 2020 19:21:19 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 17665 invoked from network); 28 May 2020 19:21:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to; bh=gUGOZriUBc+LwL11oQxwJaBcisBkrU1c6PhAsFLL0aA=; b=Zuwq5Un7lJjcm1JPSBPW0vC5BwwMMm9E1vs4mBSAoobQdyDggEnlC4B6IB7+hUDiXp 7PXr9XxJlPpUgP5cq2ArCcm7K50x1Jq5rFZZ+cvS52K4c03w9IbL9ljW+Z+ytGdtBP3g FMpLYyQHEdRjgLz9xF9Kdq/rKnCT01jLqIiTRZkcd7jNxvYDbfSqdVNOeLKvxGT2WMLk BrNev7uWz4GRETlQRupIiIKzFivRKk7nmpSIm1fQe/wt3QDTTOGY1rPQb5HPA9acLptF lPs3AdyWbl+e/umdQ2zKc1bG+ihH8mu4S5tL0qZnwmcJwh7n+g0kYxB72j7AfiBTwaFP cUnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to; bh=gUGOZriUBc+LwL11oQxwJaBcisBkrU1c6PhAsFLL0aA=; b=M/UiT9teapJYpUliWTokikSYNwm+6A3+8qeQBYjWB4MoKzqGtQi7Vcm26EIQweXzLl TmwyE/3NcQBv0TpZ9ExZe6o3/ePpgEydcDKcpIkwcl3507zaYAyHEfm+7UwJBTj9ZDxM mZT+CGlDeUhNi08J8EmANvgCghHUXNjVnPiC+NoC3/l6HCITVjVE9GvR9qDir0A9+qlK SJeJUs8fIadKKfkU3PSEkR20cEAAnyD2nnOmGdtGi7KoRRbGBIfAj7aj49iWtf8Oli8d XuA4mXc5FsDLMHV51tjIB5b70kwolOdeW9ijrY/dk3yyfXDoBQNH8eE6fvcVLS5ULE6M loPw== X-Gm-Message-State: AOAM531QWj3vZOmRvJfm1zgRMX2Ncu9JboDpLrMX4nZF6speCODSOLwx JJdh8F2jxpM6ysDZuQ4fi4clGO2M/A9P0fnb8RdpMrbwmRI= X-Google-Smtp-Source: ABdhPJyGvQONUNGyQ3c3ROJxmdibuT+uNckofhIAKF8ofk7iDJyfHFKk1/Jo5txeUbvChjTpyM/F7s4oFcO12Cbvxu0= X-Received: by 2002:a02:c848:: with SMTP id r8mr3830479jao.15.1590693664540; Thu, 28 May 2020 12:21:04 -0700 (PDT) MIME-Version: 1.0 References: <20200521152121.GA6521@voyager> <883535a2-1b26-183d-22f4-c3c158da2dbb@bell-sw.com> <20200522182555.GA1079@brightrain.aerifal.cx> <96367f9c-4b02-c512-9d46-96de9e39a059@bell-sw.com> <20200525174633.GA31470@brightrain.aerifal.cx> In-Reply-To: From: Jeffrey Walton Date: Thu, 28 May 2020 15:20:46 -0400 Message-ID: To: musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] Shared library loading On Wed, May 27, 2020 at 2:10 PM Dmitry Samersoff 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