x86_64 calling conventions and stack frames

前端 未结 4 1479
孤独总比滥情好
孤独总比滥情好 2021-02-07 17:21

I am trying to make sense out of the executable code that GCC (4.4.3) is generating for an x86_64 machine running under Ubuntu Linux. In particular, I don\'t understand how the

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-07 18:13

    If the address of argv is what you want, why not just save a pointer to it in main?
    Trying to unwind the stack would be highly unportable, even if you get it to work.
    Even if you do manage to go back over the stack, it isn't obvious that the first function's frame pointer would be NULL. The first function on the stack doesn't return, but calls a system call to exit, and therefore its frame pointer is never used. There's no good reason why it would be initialized to NULL.

提交回复
热议问题