mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: dl_iterate_phdr() behaves differently on musl and glibc
Date: Mon, 28 May 2018 16:02:43 -0400	[thread overview]
Message-ID: <20180528200243.GH1392@brightrain.aerifal.cx> (raw)
In-Reply-To: <trinity-7b253865-73f5-4a06-afc3-2e939d791ea5-1527515055693@3c-app-mailcom-bs02>

On Mon, May 28, 2018 at 03:44:15PM +0200, Bob B. wrote:
> Hi list.
> 
> I noticed a difference in behavior of dl_iterate_phdr() when playing with musl and glibc.
> The program I tried was the example on the bottom of the page: https://linux.die.net/man/3/dl_iterate_phdr
> 
> What happens is that musl returns the program itself when run + shared objects.
> glibc only returns the shared objects.
> 
> Not sure which one is right. Or if both are acceptable.
> Any light to clear why the different behavior is appreciated.

I was unaware of that difference, but omitting the main program seems
like a serious limitation that makes the interface a lot less useful.
I'm not sure if there's any other way to get the information.

The manual page documents the function as enumerating the "shared
objects", which one could interpret only as libraries, but I usually
consider a dynamic program as a "shared object" itself.

Is there a reason musl's behavior is problematic here? Even without
the ambiguity I'd be hesitant to change it since programs may be
relying on it.

Rich


  reply	other threads:[~2018-05-28 20:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-28 13:44 Bob B.
2018-05-28 20:02 ` Rich Felker [this message]
2018-05-28 21:39   ` Bob B.
2018-05-28 22:16     ` Rich Felker
2018-05-28 22:31       ` Bob B.
2018-05-28 23:16         ` Jameson Nash
2018-05-30 12:33           ` Bob B.
2018-05-28 22:34   ` Luc Van Oostenryck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180528200243.GH1392@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).