From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25965 invoked by alias); 17 Aug 2009 14:44:09 -0000 Received: (qmail 25954 invoked by uid 22791); 17 Aug 2009 14:44:08 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_52,SPF_PASS X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Aug 2009 14:43:59 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 561132F7800A for ; Mon, 17 Aug 2009 15:43:56 +0100 (BST) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dIbJbeqPT6zL; Mon, 17 Aug 2009 15:43:54 +0100 (BST) Date: Mon, 17 Aug 2009 14:44:00 -0000 Message-Id: From: Bart Veer To: ecos-patches@sourceware.org Subject: fix synth linker script Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2009-08/txt/msg00033.txt.bz2 Thanks to an option hidden away in gcc's specs file the Linux linker may synthesize a section .eh_frame_hdr. The linker script did not allow for this so this .eh_frame_hdr ended up in the middle of the .eh_frame section. Now, currently there is no eCos code for the synthetic target which actually looks at .eh_frame, so synth applications would continue to run perfectly happily. However, when current gdb loads an executable it iterates through .eh_frame looking for CIE and FDE structures. The relevant code got rather confused when it came across an eh_frame_hdr instead, and for some executables it would report an assertion failure. gdb would continue running quite happily afterwards, but the assertion failure message was disconcerting. This patch sorts out the synth linker script so that .eh_frame_hdr ends up in its own section, not mixed in with the rest of .eh_frame. Bart 2009-08-13 Bart Veer * src/synth.ld (SECTION_eh_frame): allow for a .eh_frame_hdr section. Index: src/synth.ld =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/synth/arch/current/src/synth.ld,v retrieving revision 1.9 diff -u -p -r1.9 synth.ld --- src/synth.ld 29 Jan 2009 17:49:43 -0000 1.9 +++ src/synth.ld 17 Aug 2009 14:42:17 -0000 @@ -108,13 +108,24 @@ GROUP(libtarget.a libgcc.a) _EXCEPT_END_ = ABSOLUTE(.);} \ > _region_ -#define SECTION_eh_frame(_region_, _vma_, _lma_) \ - .eh_frame _vma_ : _lma_ \ - { \ - FORCE_OUTPUT; __EH_FRAME_BEGIN__ = .; \ - KEEP(*(.eh_frame*)) \ - __FRAME_END__ = .; \ - . = . + 8; \ +#define SECTION_eh_frame(_region_, _vma_, _lma_) \ + . = _vma_ ; \ + . = ALIGN(ALIGN_LMA) ; \ + .eh_frame_hdr . : _lma_ \ + { \ + FORCE_OUTPUT; \ + *(.eh_frame_hdr) \ + } > _region_ = 0 \ + . = ALIGN(ALIGN_LMA) ; \ + .eh_frame . : FOLLOWING(.eh_frame_hdr) \ + { \ + FORCE_OUTPUT; \ + __EH_FRAME_BEGIN__ = .; \ + KEEP(*(.eh_frame)) \ + KEEP(*(.eh_frame*)) \ + __EH_FRAME_END__ = .; \ + . = ALIGN(4) ; \ + . = . + 8; \ } > _region_ = 0 #define SECTION_RELOCS(_region_, _vma_, _lma_) \