public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Cc: John Mellor-Crummey <johnmc@rice.edu>,
	Ben Woodard <woodard@redhat.com>,
	Alexander Monakov <amonakov@ispras.dot.ru>
Subject: Re: [PATCH v2 2/6] elf: Avoid unnecessary slowdown from profiling with audit (BZ#15533)
Date: Tue, 27 Jul 2021 13:12:57 -0300	[thread overview]
Message-ID: <7946bdd1-1a2a-a3c7-d1d8-d8e44232c57e@linaro.org> (raw)
In-Reply-To: <20210719143309.2848878-3-adhemerval.zanella@linaro.org>



On 19/07/2021 11:33, Adhemerval Zanella wrote:

> diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
> index e13a672ade..2abcfc996f 100644
> --- a/elf/dl-reloc.c
> +++ b/elf/dl-reloc.c
> @@ -181,7 +181,17 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
>  #ifdef SHARED
>    /* If we are auditing, install the same handlers we need for profiling.  */
>    if ((reloc_mode & __RTLD_AUDIT) == 0)
> -    consider_profiling |= GLRO(dl_audit) != NULL;
> +    {
> +      struct audit_ifaces *afct = GLRO(dl_audit);
> +      for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
> +	{
> +	  /* Profiling is needed only if PLT hooks are provided.  */
> +	  if (afct->ARCH_LA_PLTENTER != NULL
> +	      || afct->ARCH_LA_PLTEXIT != NULL)
> +	    consider_profiling = 1;
> +	  afct = afct->next;
> +	}
> +    }
>  #elif defined PROF

This is wrong since it disables la_symbind() for lazy resolution
if the audit modules does not provide the plt callbacks as well.
I will update the patch to now call la_symbind() on _dl_fixup() if
la_symbind() is set.

  parent reply	other threads:[~2021-07-27 16:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 14:33 [PATCH v2 0/6] Some rtld-audit fixes Adhemerval Zanella
2021-07-19 14:33 ` [PATCH v2 1/6] elf: Fix audit regression Adhemerval Zanella
2021-07-27 16:36   ` Florian Weimer
2021-07-19 14:33 ` [PATCH v2 2/6] elf: Avoid unnecessary slowdown from profiling with audit (BZ#15533) Adhemerval Zanella
2021-07-20  8:31   ` Alexander Monakov
2021-07-20 18:37     ` Adhemerval Zanella
2021-07-27 16:12   ` Adhemerval Zanella [this message]
2021-07-19 14:33 ` [PATCH v2 3/6] elf: Add audit tests for modules with TLSDESC Adhemerval Zanella
2021-07-19 14:33 ` [PATCH v2 4/6] elf: Do not fail for failed dlopem on audit modules (BZ #28061) Adhemerval Zanella
2021-07-19 14:33 ` [PATCH v2 5/6] elf: Suppress audit calls when a (new) namespace is empty (BZ #28062) Adhemerval Zanella
2021-07-19 14:33 ` [PATCH v2 6/6] elf: Fix initial-exec TLS access on audit modules (BZ #28096) Adhemerval Zanella
2021-07-20 22:09 ` [PATCH v2 0/6] Some rtld-audit fixes Michael Hudson-Doyle
2021-07-20 22:11   ` Michael Hudson-Doyle

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=7946bdd1-1a2a-a3c7-d1d8-d8e44232c57e@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=amonakov@ispras.dot.ru \
    --cc=johnmc@rice.edu \
    --cc=libc-alpha@sourceware.org \
    --cc=woodard@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 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 read-only IMAP folder(s) and NNTP newsgroup(s).