From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7325 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: perl native musl, ldd Date: Thu, 2 Apr 2015 17:26:38 -0400 Message-ID: <20150402212638.GB6817@brightrain.aerifal.cx> References: <551D65EF.9030802@safe.ca> <20150402161837.GA6817@brightrain.aerifal.cx> <551D87C0.4010409@safe.ca> <20150402184810.GF4456@example.net> <551DA936.2070302@safe.ca> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1428010020 7631 80.91.229.3 (2 Apr 2015 21:27:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 Apr 2015 21:27:00 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7338-gllmg-musl=m.gmane.org@lists.openwall.com Thu Apr 02 23:26:54 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YdmdZ-0000IH-1s for gllmg-musl@m.gmane.org; Thu, 02 Apr 2015 23:26:53 +0200 Original-Received: (qmail 9830 invoked by uid 550); 2 Apr 2015 21:26:51 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 9812 invoked from network); 2 Apr 2015 21:26:50 -0000 Content-Disposition: inline In-Reply-To: <551DA936.2070302@safe.ca> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7325 Archived-At: On Thu, Apr 02, 2015 at 04:40:22PM -0400, Jean-Marc Pigeon wrote: > On 04/02/2015 02:48 PM, u-wsnj@aetey.se wrote: > > On Thu, Apr 02, 2015 at 02:17:36PM -0400, Jean-Marc Pigeon wrote: > >>>> bash-4.3# ldd SysV.so > >>>> ldd (0x7f5d60dd2000) > >>>> libc.so => ldd (0x7f5d60dd2000) > >>>> Error relocating SysV.so: Perl_croak: symbol not found > >>>> Error relocating SysV.so: Perl_sv_setiv: symbol not found > >>>> Error relocating SysV.so: Perl_sv_2pv_flags: symbol not found > >>>> Error relocating SysV.so: Perl_av_store: symbol not found > >>>> etc. > > > >> I am using a packager using ldd to establish > >> dependencies list. > > > > I would not say reporting the symbols is a bug, rather that the packager > > is kind of relying on UB. Is there a specification of how a program called > > "ldd" shall format its output and which data shall be present? > > > > Rune > > > Packager Relying on ldd UB, sure!. I think calling this "UB" is a misappropriation of an unrelated term just to criticize what you're doing. You are relying on a complex utility that might have OS/libc-specific behavior that doesn't match your expectations, or that might not even exist on some systems, but that's not automatically a horrible thing as long as you know your system(s). > Using ldd was the best way I found to list one package all > dependencies (looking at ELF file type ans searching for > required external components). > If you have a better way (more standard) to propose not using > ldd that will be a good thing. idea? Using readelf (or your own ELF parsing) and looking for the DT_NEEDED entries would perhaps be a cleaner approach. It would only list direct dependencies rather than recursive ones and it would not depend on running target code (i.e. it would work equally well with cross-compiled packages). Of course this does not cover all dependencies (non-library things) but it at least automates a large part of the dependency tracking process. Rich