From: Yubin Ruan <ablacktshirt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Florian Weimer <fweimer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "Michael Kerrisk (man-pages)"
<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-man <linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
vivek-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org
Subject: Re: dl_iterate_phdr(3) needs clarification
Date: Sat, 16 Sep 2017 23:28:44 +0800 [thread overview]
Message-ID: <20170916152842.GG13267@HP.internal.baidu.com> (raw)
In-Reply-To: <480b07c2-b897-b175-036a-e304b2bba2d1-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Hi Florian,
On Sat, Sep 16, 2017 at 10:15:19AM +0200, Florian Weimer wrote:
> On 09/16/2017 05:00 PM, Yubin Ruan wrote:
> >diff --git a/man3/dl_iterate_phdr.3 b/man3/dl_iterate_phdr.3
> >index b5b75e8..35107da 100644
> >--- a/man3/dl_iterate_phdr.3
> >+++ b/man3/dl_iterate_phdr.3
> >@@ -121,10 +121,9 @@ header files.)
> > .PP
> > The
> > .I dlpi_addr
> >-field indicates the base address of the shared object
> >-(i.e., the difference between the virtual memory address of
> >-the shared object and the offset of that object in the file
> >-from which it was loaded).
> >+field indicates the base address that is mapped at runtime.
> >+For an executable this field is always 0 and for a shared
> >+object it is the address where the shared object is mapped.
>
> The part about executables is not true. The most common case probably is
> PIE executables. You see this if you compile the modified test program with
> -fpie -pie on a recent enough toolchain.
-fpie only affect address of PT_LOAD. The one inidcated by `dlpi_addr' is
always 0 for an executable. Yes there is indeed some confusion, see [1].
Yubin
[1]: https://stackoverflow.com/questions/8875876/getting-the-elf-header-of-the-main-executable
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-09-16 15:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170915084423.GB317@HP.internal.baidu.com>
[not found] ` <20170915084423.GB317-BUpDV9vzqx74NUO8LpiZZi+1pv2Z1Xu3@public.gmane.org>
2017-09-15 8:33 ` dl_iterate_phdr(3) needs clarification Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkhRo04hCoYX+SCKEr7Ai0zT9HcV_z-aZhCio+CQqO+eHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-16 12:37 ` Yubin Ruan
[not found] ` <20170916123659.GB13267-BUpDV9vzqx74NUO8LpiZZi+1pv2Z1Xu3@public.gmane.org>
2017-09-16 12:39 ` Yubin Ruan
2017-09-16 15:00 ` Yubin Ruan
[not found] ` <20170916150053.GD13267-BUpDV9vzqx74NUO8LpiZZi+1pv2Z1Xu3@public.gmane.org>
2017-09-16 8:15 ` Florian Weimer
[not found] ` <480b07c2-b897-b175-036a-e304b2bba2d1-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-09-16 15:28 ` Yubin Ruan [this message]
[not found] ` <20170916152842.GG13267-BUpDV9vzqx74NUO8LpiZZi+1pv2Z1Xu3@public.gmane.org>
2017-09-16 8:38 ` Florian Weimer
[not found] ` <45f4e59c-3be5-6edd-12a8-f158002dafc7-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-09 9:13 ` Yubin Ruan
2017-09-16 15:09 ` Yubin Ruan
[not found] ` <20170916150900.GE13267-BUpDV9vzqx74NUO8LpiZZi+1pv2Z1Xu3@public.gmane.org>
2017-09-16 15:23 ` Yubin Ruan
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=20170916152842.GG13267@HP.internal.baidu.com \
--to=ablacktshirt-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=fweimer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=vivek-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.