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=0.8 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,URIBL_BLACK,URIBL_SBL_A autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 2581 invoked from network); 17 Apr 2023 22:38:09 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 17 Apr 2023 22:38:09 -0000 Received: (qmail 20463 invoked by uid 550); 17 Apr 2023 22:38:04 -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 20425 invoked from network); 17 Apr 2023 22:38:04 -0000 Date: Mon, 17 Apr 2023 18:37:51 -0400 From: Rich Felker To: Lorenz Hipp , musl@lists.openwall.com Message-ID: <20230417223750.GP4163@brightrain.aerifal.cx> References: <2584491.vYhyI6sBWr@workhack> <20230417203109.GO3630668@port70.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230417203109.GO3630668@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Add musl-ldd for user convenience and to avoid naming conflict On Mon, Apr 17, 2023 at 10:31:09PM +0200, Szabolcs Nagy wrote: > * Lorenz Hipp [2023-04-17 04:36:24 +0200]: > > The default "ldd" program on most Linux systems is surely the script > > provided by the gnu libc implementation. > > > > Unfortunately, (for reasons I won't go into detail) their program > > cannot work properly with programs linked with musl, as it prints an > > error message : > > > > musl-gcc -o Test-musl Test-musl.c > > ldd Test-musl > > > > ./Test-musl: error while loading shared libraries: /usr/lib/libc.so: invalid ELF header > > > > Since the mentioned file is of course a linker script and just text, it > > cannot have a valid ELF header. > > > > > > Following the FAQ on the musl website at > > > > https://wiki.musl-libc.org/faq.html#Q:-Where-is-%3Ccode%3Eldd%3C/code%3E? > > > > the musl linker actually has 'ldd' functionality, which is used when > > it is called as "ldd". > > > > Quote : > > > > Just create a symlink from ld-musl-$ARCH.so to /bin/ldd. > > > > At least on machines where software is developed, it would not be > > a good idea to replace the glibc ldd script with a link to the musl > > linker, because of .. reasons (such as slightly different output behaviour). > > i think the faq should be updated to use > > /lib/ld-musl-$arch.so.1 --list path/to/exe > > which you can put in a script and name it ldd if you want. Agreed. The argv0 thing should be considered deprecated since it precludes showing the right "libc.so =>" and has other issues. Rich