[RFC]confusion about syscall

王哲 wangzhe5004 at gmail.com
Sun Jul 15 05:18:05 EDT 2012


2012/7/15 Mulyadi Santosa <mulyadi.santosa at gmail.com>

> Hi...
>
> On Sun, Jul 15, 2012 at 9:28 AM, 王哲 <wangzhe5004 at gmail.com> wrote:
> > and the second program:
> >
> > #include <stdio.h>
> > #include <unistd.h>
> >
> > int main(void)
> > {
> >     unsigned long value = 0;
> >     value = getpid();
> >     return 0;
> > }
> >
> > and disassembling it:( objdump -d a.out)
> > ...
> > 08048300 <getpid at plt>:
> >  8048300:    ff 25 00 a0 04 08        jmp    *0x804a000
> >  8048306:    68 00 00 00 00           push   $0x0
> >  804830b:    e9 e0 ff ff ff           jmp    80482f0 <_init+0x3c>
>
> Looks like jumping into vsyscall page to me...
>

   thanks for reply.
   and i wander why the address of vsyscall page is not 0xffffe000 in my
system?
...
b7806000-b7807000 r-xp 00000000 00:00 0          [vdso]
b7807000-b7827000 r-xp 00000000 08:08 2491275    /lib/i386-linux-gnu/
ld-2.15.so
b7827000-b7828000 r--p 0001f000 08:08 2491275    /lib/i386-linux-gnu/
ld-2.15.so
b7828000-b7829000 rw-p 00020000 08:08 2491275    /lib/i386-linux-gnu/
ld-2.15.so
 ...

root at glinuxi-G31M-ES2C:~# ldd /bin/ls
    linux-gate.so.1 =>  (0xb786b000)
    libselinux.so.1 => /lib/i386-linux-gnu/libselinux.so.1 (0xb7839000)
    librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb7830000)
    libacl.so.1 => /lib/i386-linux-gnu/libacl.so.1 (0xb7826000)
...

>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120715/d64166b7/attachment.html 


More information about the Kernelnewbies mailing list