Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 17 Apr 2023 18:37:51 -0400
From: Rich Felker <dalias@...c.org>
To: Lorenz Hipp <jHhvLtwZki@...isch.de>, musl@...ts.openwall.com
Subject: Re: 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 <jHhvLtwZki@...isch.de> [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

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.