From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8492 invoked by alias); 12 Aug 2008 17:42:44 -0000 Received: (qmail 8475 invoked by uid 22791); 12 Aug 2008 17:42:43 -0000 X-Spam-Check-By: sourceware.org Received: from mail.artimi.com (HELO mail.artimi.com) (194.72.81.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Aug 2008 17:41:54 +0000 Received: from ALBATROSS ([192.168.1.150]) by mail.artimi.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 12 Aug 2008 18:41:50 +0100 From: "Dave Korn" To: "'David Daney'" , "'Tom Quarendon'" Cc: , "'gcc help'" References: <48A1B059.1040400@quarendon.net> <48A1C606.8090109@avtrex.com> Subject: RE: Exception handling tables for function generated on the fly Date: Tue, 12 Aug 2008 17:58:00 -0000 Message-ID: <004401c8fca2$b8980090$9601a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <48A1C606.8090109@avtrex.com> Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg00123.txt.bz2 David Daney wrote on 12 August 2008 18:19: > Questions like this should probably go to gcc-help@gcc.gnu.org Questions about deep compiler internals and EH abis? Seems a bit intense for the where's-the-any-key list to me... >> I'm porting some code that does a kind of JIT > You don't say how you get them into memory. Are you building a shared > library and then loading it with dlopen()? "JIT" normally implies poking opcodes straight into memory at runtime. Otherwise it wouldn't be Just-In-Time compilation, it would be Way-Ages-In-Advance compilation! > If you pass -funwind-tables to gcc it will generate the necessary > unwinding information. If you put the code in a shared library and > dlopen() it it should just work. No compiler. No library. No dlopen. > If you are loading the code some other way http://en.wikipedia.org/wiki/Just-in-time_compilation > then you may have to call > some of the __register_frame* family of functions (in libgcc) passing > pointers to the appropriate .eh_frame sections of the generated code. Yes. The OP's question is "How do I generate .eh_frame data at runtime for an arbitrary function that has no throws and no catches but may call functions that throw". Tom, did you read the Dwarf spec? That should have more info than just the abi docs. cheers, DaveK -- Can't think of a witty .sigline today....