i am reading the asm code below,but i do not know what's the meaning of statement
finish(%rip)
the part of asm below:
/* compute abs address of label finish */
leaq finish(%rip), %rcx
/* save address of finish as return-address for context-function */
/* will be entered after context-function returns */
movq %rcx, 0x40(%rax)
ret /* return pointer to context-data */
finish:
/* exit code is zero */
xorq %rdi, %rdi
/* exit application */
call _exit@PLT
hlt
i have search many answer ,the most likely answer is below:
lea eax, msg
makes no sense -- the source is the label (address) msg, which is a (link time) constant and is not in memory anywhere. answer from
question:
i still do not know what's meaning of finish(%rip).
i know finish is label , rip is register ,but what's meaning of finish(%rip)?