why does mcount require frame pointer information?

27 views Asked by At

There is mention in the talk at kernel recipes that mcount requires frame pointers while __fentry__ does not. Can someone provide more detail on why the former needs frame pointers and how the latter avoids needing it?

Disassembling a trivial function void handler(){} With -pg alone

        push    rbp
        mov     rbp, rsp
1:      call        mcount
        nop
        pop     rbp
        ret

With -pg -mcount

1:      call        __fentry__
        push    rbp
        mov     rbp, rsp
        nop
        pop     rbp
        ret
0

There are 0 answers