This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how is the eh_frame section used?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]