On Fri, Jun 14, 2013 at 2:07 AM, Nick Wellnhofer <[email protected]> wrote:
>> Here's what gdb prints out for the assembler.  I don't understand the
>> `push`
>> and `pop` instructions.
>>
>> Dump of assembler code for function cfish_thunk112:
>> 0x0000000100075120 <cfish_thunk112+0>: push   %rbp
>> 0x0000000100075121 <cfish_thunk112+1>: mov    %rsp,%rbp
>> 0x0000000100075124 <cfish_thunk112+4>: mov    0x8(%rdi),%rax
>> 0x0000000100075128 <cfish_thunk112+8>: pop    %rbp
>> 0x0000000100075129 <cfish_thunk112+9>: jmpq   *0x70(%rax)
>> 0x000000010007512c <cfish_thunk112+12>: nopl   0x0(%rax)
>> End of assembler dump.
>
>
> The push and pop instructions are for setting up the frame pointer in %rbp.
> They'll disappear if you compile with -fomit-frame-pointer.
>

I apologize if this is one of those places where I was extrapolating
wrongly.  I had presumed that the frame pointer was omitted on all x64
compiles, and not just for Linux.  And that this was probably CLang
rather than GCC.

But why is it being pushed and popped with no intervening function
call?  Is the ghost it leaves on the stack used for something?

--nate

Reply via email to