Re: vdso

vijay nag <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAKhyrx9xNG6xEtVf51ig-dC93=C9vrzgi98RzjA4QLyfuE+hkw@mail.gmail.com>
On Wed, Jul 3, 2013 at 2:12 PM, Jan Kratochvil
<[email protected]> wrote:
> On Wed, 03 Jul 2013 10:34:43 +0200, vijay nag wrote:
>> cat /proc/15896/smaps | grep vdso
>> 778:b7fff000-b8000000 r-xp b7fff000 00:00 0          [vdso]
>>
>> Does vdso come with symbols ?
>
> For basic ELF symbols it does. Try:
>         dump memory /tmp/vdso.so 0xb7fff000 0xb8000000
>         readelf -Ws /tmp/vdso.so
>
> and .dynsym section there should contain the symbols:
>      4: ffffffffff700ba0   404 FUNC    GLOBAL DEFAULT   15 __vdso_gettimeofday@@LINUX_2.6
>      5: ffffffffff700d60    61 FUNC    GLOBAL DEFAULT   15 __vdso_getcpu@@LINUX_2.6
> etc.
>
> Then there are also DWARF symbols to see even filenames / line numbers but
> those .debug_* sections at least Fedora ships only on disk in kernel-debuginfo
> rpm. The symbols get loaded automatically by GDB:
> lrwxrwxrwx 1 root root 61 Jul  2 00:43 /usr/lib/debug/.build-id/92/0bba09195bde2b45a7a4eaec1dc78c3157c0f5 -> ../../../../../lib/modules/3.9.8-200.fc18.x86_64/vdso/vdso.so*
> lrwxrwxrwx 1 root root 58 Jul  2 00:43 /usr/lib/debug/.build-id/92/0bba09195bde2b45a7a4eaec1dc78c3157c0f5.debug -> ../../lib/modules/3.9.8-200.fc18.x86_64/vdso/vdso.so.debug
> -rwxr-xr-x 1 root root   4856 Jun 28 16:56 /lib/modules/3.9.8-200.fc18.x86_64/vdso/vdso.so*
> -r--r--r-- 1 root root 104848 Jun 28 16:56 /usr/lib/debug/lib/modules/3.9.8-200.fc18.x86_64/vdso/vdso.so.debug
> $ rpm -qf /lib/modules/3.9.8-200.fc18.x86_64/vdso/vdso.so /usr/lib/debug/lib/modules/3.9.8-200.fc18.x86_64/vdso/vdso.so.debug
> kernel-3.9.8-200.fc18.x86_64
> kernel-debuginfo-3.9.8-200.fc18.x86_64
>
>
> You should check first /tmp/vdso.so to see whether your Linux kernel or GDB is
> the problem.
>
>
> Jan

Following are output of readelf and something is surely amiss like you suggested

readelf -Ws /tmp/vdso.so

Symbol table '.dynsym' contains 9 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: ffffe400     0 SECTION LOCAL  DEFAULT    6
     2: ffffe478     0 SECTION LOCAL  DEFAULT    8
     3: ffffe480     0 SECTION LOCAL  DEFAULT    9
     4: ffffe618     0 SECTION LOCAL  DEFAULT   11
     5: ffffe400    20 FUNC    GLOBAL DEFAULT    6 __kernel_vsyscall@@LINUX_2.5
     6: 00000000     0 OBJECT  GLOBAL DEFAULT  ABS LINUX_2.5
     7: ffffe440     7 FUNC    GLOBAL DEFAULT    6
__kernel_rt_sigreturn@@LINUX_2.5
     8: ffffe420     8 FUNC    GLOBAL DEFAULT    6 __kernel_sigreturn@@LINUX_2.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.