This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PT_GNU_EH_FRAME semantics
- From: Jakub Jelinek <jakub at redhat dot com>
- To: heliosc at mindspring dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 25 Sep 2002 08:45:33 +0200
- Subject: Re: PT_GNU_EH_FRAME semantics
- References: <Springmail.0994.1032934097.0.68299700@webmail.atl.earthlink.net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Sep 25, 2002 at 02:08:17AM -0400, heliosc@mindspring.com wrote:
> Hi, my name is Rayiner Hashem. I've been working on writing an ELF loader (for
> use in a kernel) that will handle all of gcc generated code, including C++
> exceptions. I'm having a little trouble figuring out the purpose and semantics
> of the PT_GNU_EH_FRAME load flag. From what I gather, its there to allow the
> EH frames to stay unloaded until an exception actually occurs. According to
> posts on this mailing list, the linker is supposed to sort the eh_frame
> sections in the object files and stuff them into a program segment and flag it
> with PT_GNU_EH_FRAME. Is this description even close to being on track? I
> would appreciate it if someone could give at least a general idea of how this
> works, so I know what to look out for when wading through ld.
>
> PS> Is there anybody out there documenting all this? GCC used to be the most
> well-documented compiler out there, but much of the current stuff isn't even
> applicable anymore. Maybe after the flurry of activity with respect to C++ is
> over?
PT_GNU_EH_FRAME segment serves two purposes. One is for locating the
.eh_frame section and its size at runtime (where section table
is not loaded). The other is an optimization - if possible
linker generates a sorted table for binary searches.
The format is documented in binutils bfd/elf-eh-frame.c.
Jakub