Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jan 1998 21:52:07 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        jfieber@indiana.edu (John Fieber)
Cc:        moore@wolfenet.com, hackers@FreeBSD.ORG
Subject:   Re: egcs and exceptions
Message-ID:  <199801222152.OAA21964@usr07.primenet.com>
In-Reply-To: <Pine.BSF.3.96.980122111110.8321E-100000@fallout.campusview.indiana.edu> from "John Fieber" at Jan 22, 98 11:20:41 am

next in thread | previous in thread | raw e-mail | index | archive | help
> >    Date: Wed, 21 Jan 1998 19:00:22 -0500 (EST)
> >    From: John Fieber <jfieber@indiana.edu>
> > 
> >    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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801222152.OAA21964>