This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: --eh-frame-hdr must never fail


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


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