From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3496 Path: news.gmane.org!not-for-mail From: Justin Cormack Newsgroups: gmane.linux.lib.musl.general Subject: Re: dlinfo Date: Sat, 29 Jun 2013 17:34:46 +0100 Message-ID: References: <20130629155359.GJ29800@brightrain.aerifal.cx> <20130629163117.GL29800@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d042ef48dc8d9a004e04d924b X-Trace: ger.gmane.org 1372523702 13850 80.91.229.3 (29 Jun 2013 16:35:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Jun 2013 16:35:02 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3500-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jun 29 18:35:01 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 1Usy71-0008Af-F0 for gllmg-musl@plane.gmane.org; Sat, 29 Jun 2013 18:34:59 +0200 Original-Received: (qmail 30186 invoked by uid 550); 29 Jun 2013 16:34:58 -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 30167 invoked from network); 29 Jun 2013 16:34:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=specialbusservice.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=EfAmkul/F2DZkJ2TuETy3qce4cE+krm1gqAyLdoqHaQ=; b=BLOmD+sNIZP3UYjgkTwmBoG//chrd5J3pdW7Fm8nWYX75G0NlAPDmnXmqViF7tqlU+ xbKOqrADi0FLzua51rpKXe8AyTDbg2hePW7TJf/h3bx+BhsHutdySBpLqtZ/1BxqnssM u+LBxli4hG+OlAOXZQ82BclUGEhAYskAqK2r0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=EfAmkul/F2DZkJ2TuETy3qce4cE+krm1gqAyLdoqHaQ=; b=JL7fS25m8p3yB1MY4l6pfNugTLkRB2ycJRP+dNAy1AkIuZaWJaP4zyKTgU5VJuLT3v EvlDJUSXXIwihOJYZ9Jk7pVOL8+S80OVGcKnCfGkJcyuU5eeKT1YPPe2+xsfTpLWF9hJ XCY3XvGUhxl+qw2p+0WRfBy1yVTuNLZft3goB2pBvQCSpgqqjYx/H8oFFCXvcgFKKQJK A5LenD7oicI/RbGpRmUSxwofHacQk9tkWxhAZy1cC6WHSFAtkwwTvOI9uNy9u/9XTDN2 RTJzH4Ycu8aNNg9tU9cUX7KMHpQDjnLKfkt/UcIS/KugNVZ5ZIpqEcFVMDs5IZqD5wGw 21Zg== X-Received: by 10.66.83.7 with SMTP id m7mr16694077pay.150.1372523686576; Sat, 29 Jun 2013 09:34:46 -0700 (PDT) In-Reply-To: <20130629163117.GL29800@brightrain.aerifal.cx> X-Gm-Message-State: ALoCoQnc+gN+bBMBeSxoHQxZeGN6HPv/TeJvTTpXXaK1cMzkFaoQNmVQipVFOwK0U6miFZ1GTc6i Xref: news.gmane.org gmane.linux.lib.musl.general:3496 Archived-At: --f46d042ef48dc8d9a004e04d924b Content-Type: text/plain; charset=UTF-8 On 29 Jun 2013 17:31, "Rich Felker" wrote: > > 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 Thanks! --f46d042ef48dc8d9a004e04d924b Content-Type: text/html; charset=UTF-8


On 29 Jun 2013 17:31, "Rich Felker" <dalias@aerifal.cx> wrote:
>
> On Sat, Jun 29, 2013 at 05:14:16PM +0100, Justin Cormack wrote:
> > On 29 Jun 2013 16:54, "Rich Felker" <dalias@aerifal.cx> 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

Thanks!

--f46d042ef48dc8d9a004e04d924b--