[PATCH] Fix EH frame problem on Solaris

Eric Botcazou ebotcazou@adacore.com
Thu Sep 25 17:25:00 GMT 2008


Hi,

EH is broken with GCC mainline on Solaris (both SPARC and x86) if you use the 
combination GCC + GAS + Sun ld: FDEs from libgcc_eh.a are not found in the 
final executable by the unwinder; therefore it immediately aborts.

The problem is that the Sun linker doesn't merge read-only and read-write 
sections into a single read-write section.  This was working fine when GCC 
was emitting the EH frame itself because GCC features a configure check, 
namely HAVE_LD_RO_RW_SECTION_MIXING, that forces the section to be writable
if it fails.  Now GAS is emitting the EH frame, sometimes read-only and 
sometimes read-write depending on the relocations, and this breaks.

Fixed by defining DWARF2_EH_FRAME_READ_ONLY to 0 on Solaris, tested both on 
SPARC and x86.  OK for mainline and 2.19 branch?


2008-09-25  Eric Botcazou  <ebotcazou@adacore.com>

gas/
	* Makefile.am (TARG_ENV_HFILES): Add config/te-solaris.h.
	* Makefile.in (TARG_ENV_HFILES): Likewise.
	* configure.tgt (Solaris targets): Set em=solaris.
	* config/te-solaris.h: New file.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 3821 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20080925/80ad52ab/attachment.bin>


More information about the Binutils mailing list