x86_64 calling conventions and stack frames

Ian Lance Taylor iant@google.com
Tue Dec 27 15:16:00 GMT 2011


Amittai Aviram <amittai.aviram@yale.edu> writes:

> 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 code keeps track of stack
> frames.

On x86_64 gcc will by default generate unwind tables which can be used
at runtime to unwind the stack.  These unwind tables are stored in the
.eh_frame section.  The format is described in the x86_64 ELF processor
supplement or at http://www.airs.com/blog/archives/460 .

As of gcc 4.6 gcc defaults to this behaviour on i386 as well.

You can change it by using -fno-omit-frame-pointer.

Ian



More information about the Gcc-help mailing list