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=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31158 invoked from network); 17 Apr 2023 20:31:25 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 17 Apr 2023 20:31:25 -0000 Received: (qmail 5955 invoked by uid 550); 17 Apr 2023 20:31:22 -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 5920 invoked from network); 17 Apr 2023 20:31:21 -0000 Date: Mon, 17 Apr 2023 22:31:09 +0200 From: Szabolcs Nagy To: Lorenz Hipp Cc: musl@lists.openwall.com Message-ID: <20230417203109.GO3630668@port70.net> Mail-Followup-To: Lorenz Hipp , musl@lists.openwall.com References: <2584491.vYhyI6sBWr@workhack> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2584491.vYhyI6sBWr@workhack> Subject: Re: [musl] Add musl-ldd for user convenience and to avoid naming conflict * 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.