All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Florian Weimer <fweimer@redhat.com>, linux-man@vger.kernel.org
Cc: mtk.manpages@gmail.com, sguelton@redhat.com
Subject: Re: [PATCH] ld.so.8: List more places in which dynamic string tokens are expanded
Date: Mon, 20 Jul 2020 13:55:14 +0200	[thread overview]
Message-ID: <8bb0f5b8-424c-3255-4c1f-ad4f493b2463@gmail.com> (raw)
In-Reply-To: <87zh7uy094.fsf@oldenburg2.str.redhat.com>

Hi Florian,

On 7/20/20 12:00 PM, Florian Weimer wrote:
> This happens for more than just DT_RPATH/DT_RUNPATH.
> 
> Signed-off-by: Florian Weimer <fweimer@redhat.com>

Thanks! Patch applied.

The page already mentioned that these tokens were usable with
LD_LIBRARY_PATH, LD_PRELOAD, and LD_AUDIT, but I was unaware of
the other places where they are applicable.

Cheers,

Michael

> ---
>  man8/ld.so.8 | 42 +++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 37 insertions(+), 5 deletions(-)
> 
> diff --git a/man8/ld.so.8 b/man8/ld.so.8
> index 2e98b7f5a..80f57a541 100644
> --- a/man8/ld.so.8
> +++ b/man8/ld.so.8
> @@ -97,12 +97,41 @@ and then
>  If the binary was linked with the
>  .B \-z nodeflib
>  linker option, this step is skipped.
> -.SS Rpath token expansion
> +.SS Dynamic string tokens
>  .PP
> -The dynamic linker
> -understands certain token strings in an rpath specification
> -(DT_RPATH or DT_RUNPATH).
> -Those strings are substituted as follows:
> +In several places, the dynamic linker expands dynamic string tokens:
> +.IP o 3
> +In the environment variables
> +.BR LD_LIBRARY_PATH ,
> +.BR LD_PRELOAD ,
> +and
> +.BR LD_AUDIT ,
> +.IP o 3
> +inside the values of the dynamic section tags
> +.BR DT_NEEDED ,
> +.BR DT_RPATH ,
> +.BR DT_RUNPATH ,
> +.BR DT_AUDIT ,
> +and
> +.BR DT_DEPAUDIT
> +of ELF binaries,
> +.IP o 3
> +in the arguments to the
> +.B ld.so
> +command line options
> +.BR \-\-audit ,
> +.BR \-\-library-path ,
> +and
> +.B \-\-preload
> +(see below), and
> +.IP o 3
> +in the file name arguments to the
> +.BR dlopen (3)
> +and
> +.BR dlmopen (3)
> +functions.
> +.PP
> +The substituted tokens are as follows.
>  .TP
>  .IR $ORIGIN " (or equivalently " ${ORIGIN} )
>  This expands to
> @@ -156,6 +185,9 @@ value in the auxiliary vector (see
>  .\"
>  .\" ld.so lets names be abbreviated, so $O will work for $ORIGIN;
>  .\" Don't do this!!
> +.PP
> +Note that the dynamic string tokens have to be quoted properly when
> +set from a shell, to prevent their expension as environment variables.
>  .SH OPTIONS
>  .TP
>  .BI \-\-audit " list"
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

      reply	other threads:[~2020-07-20 11:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 10:00 [PATCH] ld.so.8: List more places in which dynamic string tokens are expanded Florian Weimer
2020-07-20 11:55 ` Michael Kerrisk (man-pages) [this message]

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=8bb0f5b8-424c-3255-4c1f-ad4f493b2463@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=linux-man@vger.kernel.org \
    --cc=sguelton@redhat.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.
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.