This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: how is the eh_frame section used?
- From: Ian Lance Taylor <iant at google dot com>
- To: Ethan Tira-Thompson <ejt at andrew dot cmu dot edu>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 24 Apr 2007 11:39:03 -0700
- Subject: Re: how is the eh_frame section used?
- References: <B5B8F89A-583F-4936-B899-1CCAC3FF6A99@andrew.cmu.edu>
Ethan Tira-Thompson <ejt@andrew.cmu.edu> writes:
> I would like to know how the data in the eh_frame section is used
> during runtime, and why the section changes based on the presence/
> absence of the -r flag. (the data section does not change in terms
> of size or layout between the two products, however the eh_frame
> section does, and this throws off my extraction of relocation table
> information; I'm targeting MIPS with elf-format output)
The eh_frame data is used to unwind the stack when an exception is
thrown. It records things like where to find the return address and
which registers are stored where.
The linker does some automatic optimization of the .eh_frame section
when linking. See bfd/elf-eh-frame.c. I would guess that perhaps it
does not do that when linking with -r.
Ian