Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: Yao Qi <qiyaoltc@gmail.com>,  gdb-patches@sourceware.org
Subject: Re: warning: Could not load shared library symbols for linux-vdso.so.1.
Date: Fri, 12 Aug 2016 10:28:00 -0000	[thread overview]
Message-ID: <86eg5ucmcv.fsf@gmail.com> (raw)
In-Reply-To: <89b5bdc8-0be2-538e-3932-1f5d4a1bc1e8@redhat.com> (Pedro Alves's	message of "Thu, 11 Aug 2016 16:57:27 +0100")

Pedro Alves <palves@redhat.com> writes:

> Is there an easy way to check whether we're in the vdso prelinked
> situation just from doing some address comparisions?  I feel like that
> should be possible, but I didn't think it through.  It is is indeed
> possible, we could alwayy skip the /proc/pid/maps parsing entirely
> even against live processes, on modern kernels.

I don't know either.  However, looks vDSO prelink is done only on x86
and was already removed from kernel in 2014, as far as I can see.  The
base address of vDSO in kernel is VDSO_PRELINK, which is hard-coded.  I
am not sure we can rely on this hard-coded constant.

> -	  if (address_in_mem_range (so->lm_info->l_ld, &vsyscall_range))
> +	  if (vsyscall_range.length != 0
> +	      && address_in_mem_range (so->lm_info->l_ld, &vsyscall_range))
> +	    {
> +	      *sop = so->next;
> +	      free_so (so);
> +	      break;
> +	    }
> +
> +	  /* However, if we only know the starting address address,
> +	     try a simple match.  XXX: Is there an easy "SO is
> +	     prelinked" check we could do here?  */
> +	  if (vsyscall_range.length == 0
> +	      && so->lm_info->l_addr_inferior == vsyscall_range.start)
>  	    {
>  	      *sop = so->next;
>  	      free_so (so);

Patch is good to me.  One nit, we can merge these two condition checks,
so we can delete SO in the list in one place.

-- 
Yao (齐尧)


  reply	other threads:[~2016-08-12 10:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 11:46 Yao Qi
2016-08-11 15:57 ` Pedro Alves
2016-08-12 10:28   ` Yao Qi [this message]
2016-08-19  1:05     ` Pedro Alves
2016-08-19  9:59       ` Yao Qi
2016-08-19 10:32         ` Pedro Alves
2016-08-19 11:41           ` Yao Qi
2016-08-19 14:02             ` Pedro Alves
2016-08-22  9:36               ` Yao Qi
2016-08-22 19:47                 ` Pedro Alves

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=86eg5ucmcv.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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