[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: __cxa_atexit and __dso_handle



"Martin v. Löwis" <martin@v.loewis.de> writes:

[ Please CC replies to me - thankyou ]

> David N. Welton wrote:

> > The problem is that despite using -nostdlib whilst compiling, I
> > still get __cxa_atexit and __dso_handle defined in my .o files
> > (yes, eCos utilizes C++ in places).

> I think the problem is not that you are getting definitions, but
> that you are getting references to these symbols.

Well... sure.  I get linking errors if I don't do something to avoid
those symbols, or insert fake ones in my code.

> > I found a switch to turn off __cxa_atexit, but found nothing for
> > the other one.  Is it possible to get gcc 3.[recent] to generate
> > executables suitable for standalone execution?  If not, I think it
> > ought to be!

> You mean, whether g++ supports free-standing (as opposed to hosted)
> development? It certainly does: __dso_handle is part of the minimum
> run-time that you need in a free-standing environmnent. Just supply
> a minimum definition for it, and be done with it: it needs to be
> some address. In general, it needs to be unique per shared library,
> but if you don't have shared libraries, a single definition will do.

Great, this is the information I need!

Since I don't have shared libraries, is it ok if I just define it,
just so it's there?

void*   __dso_handle = (void*) &__dso_handle;

BTW, can you also confirm that this is for C++ only?

This is an embedded system, more or less, so it just sits there and
runs...

Thanks for your time,
-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/



Reply to: