user3691131
user3691131

Reputation: 41

Understanding callq instruction in assembly

I am new to assembly language. During analysis of coredump file i wanted to understand function call at assembly level.

After googling found that callq is the instruction to call a function.

  Syntax:
      callq "function Name"

However, in core file the syntax is different.

          10cd52f:   ff 90 10 02 00 00       callq  *0x210(%rax) 

Kindly let me know What is this means?

Upvotes: 1

Views: 1882

Answers (1)

fuz
fuz

Reputation: 93034

That's an indirect call instruction: it loads a qword of memory from 0x210(%rax) and calls the function at the address found in that word. You can tell that it's an indirect call from the * in front of the operand. Refer to the instruction set reference and the GNU assembler manual for details.

Normal relative calls have the syntax you described above:

call function

note that the q suffix can be omitted.

Upvotes: 2

Related Questions