This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: --eh-frame-hdr must never fail
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 3 Jul 2007 21:13:37 +0200
- Subject: Re: --eh-frame-hdr must never fail
- References: <m3bqetfsme.fsf@localhost.localdomain>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Jul 03, 2007 at 07:51:05AM -0700, Ian Lance Taylor wrote:
> The --eh-frame-hdr option directs the program linker to create a table
> of FDEs. This table is used by gcc's exception handler library to
> locate FDEs at runtime. The gcc configure script tests the linker to
> see whether it supports the --eh-frame-hdr option. If it does not,
> gcc generates code to register FDEs at runtime. If it does, gcc
> assumes that it will be able to use the table created by the linker.
>
> This means that if the linker ever fails to create the table, or if
> the table is incomplete, then exception handling will fail at runtime.
No, the table doesn't need to be created, only .eh_frame_hdr section
must be present and tell libgcc_{s,eh} where to find .eh_frame section
and that the binary search table is or is not present, plus PT_GNU_EH_FRAME
must be present when --eh-frame-hdr.
When libgcc_{s,eh} detects PT_GNU_EH_FRAME, which doesn't provide binary
search table, it will still work, just far slower.
AFAIK Alan added recently a warning if we fail to create the binary search
table, as it has performance consequences.
Jakub