This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: warning: Could not load shared library symbols for linux-vdso.so.1.


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 (齐尧)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]