destructors not running

Kulpinski, Jay Jay.Kulpinski@gd-ais.com
Thu May 29 15:41:00 GMT 2003


I'm trying to update my powerpc-eabi tools to a more modern version
(gcc-3.3, binutils-2.13.2.1, newlib-20030516).  Global object destructors
are not being called in a program built for the "sim" target.  Does
anyone know how they are expected to be invoked?  Is this likely a 
problem in the linker script or the startup files?  I did some poking
around, but it's not obvious to me.

----------------------
$ powerpc-eabi-g++ -msim -g test.cc
$ powerpc-eabi-run a.out
in constructor
main prog
$
----------------------
/* test.cc */
#include <iostream>
using namespace std;

class x {
public:
    x() {
        cout << "in constructor" << endl;
    }

    ~x() {
        cout << "in destructor" << endl;
    }
};

x instance;

int main(int argc, char **argv) {
    cout << "main prog" << endl;
    return 0;
}


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list