From owner-freebsd-hackers Thu Jan 22 13:52:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA24377 for hackers-outgoing; Thu, 22 Jan 1998 13:52:29 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA24357 for ; Thu, 22 Jan 1998 13:52:17 -0800 (PST) (envelope-from tlambert@usr07.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id OAA29237; Thu, 22 Jan 1998 14:52:12 -0700 (MST) Received: from usr07.primenet.com(206.165.6.207) via SMTP by smtp04.primenet.com, id smtpd029227; Thu Jan 22 14:52:09 1998 Received: (from tlambert@localhost) by usr07.primenet.com (8.8.5/8.8.5) id OAA21964; Thu, 22 Jan 1998 14:52:07 -0700 (MST) From: Terry Lambert Message-Id: <199801222152.OAA21964@usr07.primenet.com> Subject: Re: egcs and exceptions To: jfieber@indiana.edu (John Fieber) Date: Thu, 22 Jan 1998 21:52:07 +0000 (GMT) Cc: moore@wolfenet.com, hackers@FreeBSD.ORG In-Reply-To: from "John Fieber" at Jan 22, 98 11:20:41 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk > > Date: Wed, 21 Jan 1998 19:00:22 -0500 (EST) > > From: John Fieber > > > > I just built egcs in eager anticipation of working exceptions. > > No dice (just an Abort Trap). Is this something that only works > > on -current? (I'm running 2.2.5) > > > > It doesn't seem to work in -current either, for me. I need to build > > an elf-capabile gdb to debug this. > > Hmm... It appears as though explicit manual template > instantiation is the only way to use templates too. :( Maybe the > "do nothing" method described in the docs now assumes an ELF > system? Yes. There are three methods (according to the C++ comittee member I talked to about this): 1) Create a static instance per object module that uses the template class. This was the initial approach, and resulted in duplicate code. 2) Create a single real instance, and reference it from all objects instantiated of that type. This was the initial workaround to the duplicate code problem, but required specific glue to make work. The glue was hidden in one version of G++ or another. 3) Create an instance per object module that uses the template class. Unlike #1, however, you create the instance in a special section of the object file. At link time, all duplicate sections of this type are discarded. #3 requires that you have an object file format that supports multiple sections, and further that each template object instance be in a seperate section from each other template object instance of a given type, such that you can take a single intersection set (obj A has i. and ii., obj B has ii. and iii., but you only want one instance of ii.). > I'll have to look at the configuration options. I found a blurb > on dejanews suggesting that NetBSD needs a new gas for exceptions > to work, but if you configure it for setjmp/longjmp (which > involves a runtime overhead), they will work. I don't mind the > overhead if it is just a temporary state of affairs.... The new gas is required to allow for a new weak symbol type; this saves you from having to define an ELF section flag; instead, you can define a "normal" ELF section that contains only weak (potentially duplicate) symbols. Then the LD can see the weak symbols, and do the right thing. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.