From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3495 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: dlinfo Date: Sat, 29 Jun 2013 12:31:17 -0400 Message-ID: <20130629163117.GL29800@brightrain.aerifal.cx> References: <20130629155359.GJ29800@brightrain.aerifal.cx> 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 1372523489 12287 80.91.229.3 (29 Jun 2013 16:31:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Jun 2013 16:31:29 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3499-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jun 29 18:31:30 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Usy3e-0004Yb-7W for gllmg-musl@plane.gmane.org; Sat, 29 Jun 2013 18:31:30 +0200 Original-Received: (qmail 25853 invoked by uid 550); 29 Jun 2013 16:31:29 -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 25844 invoked from network); 29 Jun 2013 16:31:29 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3495 Archived-At: On Sat, Jun 29, 2013 at 05:14:16PM +0100, Justin Cormack wrote: > On 29 Jun 2013 16:54, "Rich Felker" wrote: > > > > On Sat, Jun 29, 2013 at 04:40:17PM +0100, Justin Cormack wrote: > > > Has anyone got any plans to implement dlinfo? > > > > I'm not opposed to it, but not sure how easy it would be. > > RTLD_DI_LINKMAP looks trivial (just return the argument passed in), > > but the origin and search information is stuff that's probably not > > saved with the current dynamic linker implementation. > > Linkmap is the only bit I need actually. NetBSD apparently only implements > that and not the rest, so it is not unprecedented. As a quick workaround then: -D'dlinfo(x,y,z)=(*(struct link_map *)(z) = (void *)(x))' Kidding aside, I wouldn't actually recommend this, since you'd be encoding implementation internals (the fact that the dso handle is actually the link_map pointer) into the application, which could badly break if the implementation is ever changed. I'll just go ahead and add this limited version of dlinfo; look for it soon and ping me if you don't see it. Rich