[HELP] asm language explanation about callq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I wrote following C program:

#include <linux/module.h>
#include <linux/init.h>

static int param = 4096;
static unsigned long int addr = 0xffff88080984b000;
module_param(param, int, S_IRUGO);
module_param(addr, ulong, S_IRUGO);

static int test_init(void)
{
    memset((void *)addr, 0, param);

    return(-1);
}

static void test_exit(void)
{
}

module_init(test_init);
module_exit(test_exit);

MODULE_LICENSE("GPL");

Then, I compile it, and objdump -d test.o:

test.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <cleanup_module>:
   0:    55                       push   %rbp
   1:    48 89 e5                 mov    %rsp,%rbp
   4:    e8 00 00 00 00           callq  9 <cleanup_module+0x9>
   9:    c9                       leaveq
   a:    c3                       retq
   b:    0f 1f 44 00 00           nopl   0x0(%rax,%rax,1)

0000000000000010 <init_module>:
  10:    55                       push   %rbp
  11:    48 89 e5                 mov    %rsp,%rbp
  14:    e8 00 00 00 00           callq  19 <init_module+0x9>
  19:    48 63 15 00 00 00 00     movslq 0x0(%rip),%rdx        # 20
<init_module+0x10>
  20:    48 8b 3d 00 00 00 00     mov    0x0(%rip),%rdi        # 27
<init_module+0x17>
  27:    31 f6                    xor    %esi,%esi
  29:    e8 00 00 00 00           callq  2e <init_module+0x1e>
  2e:    b8 ff ff ff ff           mov    $0xffffffff,%eax
  33:    c9                       leaveq
  34:    c3                       retq
  35:    90                       nop
  36:    90                       nop
  37:    90                       nop

Can someone explain what the meaning of three "callq" instruction in objdump's
output, especially the arguments of "callq".

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs



[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux