Thanks - I stopped attempting to call them & now I get further in the process. --Wes ________________________________________ From: Ian Lance Taylor [iant@xxxxxxxxxx] Sent: Wednesday, September 26, 2012 6:07 AM To: Schmidt, Weston Cc: gcc-help@xxxxxxxxxxx Subject: Re: __do_global_ctors missing On Mon, Sep 24, 2012 at 4:06 PM, Schmidt, Weston <Weston_Schmidt@xxxxxxxxxxxxxxxxx> wrote: > > I'm having trouble attempting to upgrade from a 2.95 mips-wrs-elf compiler to a 4.7.2 mips-wrs-elf compiler. I believe the link time options are the same: > > ../gcc-4.7.2/configure \ > --target=mips-wrs-elf --enable-languages=c,c++ \ > --disable-nls --disable-libssp --with-system-zlib \ > --enable-targets=mips-wrs-elf --disable-threads --with-newlib --disable-shared --without-included-gettext \ > --enable-newlib-mb --enable-newlib-io-long-long \ > --enable-version-specific-runtime-libs > > When I inspect the libgcc.a file for the 4.7.2 compiler, there are no __do_global_ctors or __do_global_dtors functions in __main.o. > > I expected to see something like this (from the 2.95 release): > __main.o: > U __CTOR_LIST__ > U __DTOR_LIST__ > 00000074 T __do_global_ctors > 00000000 T __do_global_dtors > 00000104 T __gccmain > 00000000 t __gnu_compiled_c > 00000000 t gcc2_compiled. > 00000000 b initialized.10 > 00000000 d p.3 > > Instead __main.o is empty. I'm stumped & can't finish linking my cross-compiled project because it needs direct access to the __do_global_ctors/dtors functions. In current GCC, when using ELF, constructors and destructors are run by putting them in DT_INIT_ARRAY and DT_FINI_ARRAY sections. There are no __do_global_ctors/dtors functions because they are not necessary. You could try using --disable-initfini-array when you run configure. Ian