x86_64 calling conventions and stack frames

前端 未结 4 1478
孤独总比滥情好
孤独总比滥情好 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 17:59

    Assuming that I am linking with glibc (which I am doing), it looks as if I can solve this problem for practical purposes with the glibc global symbol __libc_stack_end:

    extern void * __libc_stack_end;
    
    void myfunction(void) {
      /* ... */
      off_t stack_hi = (off_t)__libc_stack_end;
      /* ... */
    }
    

提交回复
热议问题