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:

> > 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.
> Ah, so eh_frame is just a table of meta-data describing the code in
> the data section, right?  (no executable code in eh_frame itself?)
> And I'm guessing it needs relocation entries in order to reference
> the sizes/positions of items linked in other sections?

Yes.

> > bfd/elf-eh-frame.c
> This file is in binutils... looking through it shows how to read/
> write the data, which is half the battle, but the data is apparently
> being generated elsewhere.

Yes.

> Do you know where I can look in gcc to find the eh_frame generation?
> (or better yet, some insight into what I would need to change to
> either make eh_frame consistent or make it use R_MIPS_PC32 type
> relocation entries?)

It's generated by gcc/dwarf2out.c.  Search for for_eh.

I think R_MIPS_32 vs. R_MIPS_PC32 would be controlled by
ASM_PREFERRED_EH_DATA_FORMAT.

Ian


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