Xref: utzoo comp.realtime:1152 gnu.g++.help:453 Path: utzoo!utgpu!watserv1!watmath!uunet!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!stiatl!srchtec.searchtech.com!monica From: monica@srchtec.searchtech.com (Monica Skidmore) Newsgroups: comp.realtime,gnu.g++.help Subject: initialization with g++ and vxWorks Keywords: g++,vxWorks Message-ID: <1991Feb8.150548.25891@srchtec.uucp> Date: 8 Feb 91 15:05:48 GMT Sender: monica@srchtec.uucp (Monica Skidmore) Organization: search technology, inc. Lines: 28 We are running vxWorks 4.0 (soon to be upgraded to vxWorks 5.0) on 68030 processors. We are using C++, compiled on a SUN 380 for the processors, and are in the process of changing from AT&T's cfront to gnu g++ 1.37.0. Our problem is that the initialization of user defined objects that are globally visible is not done when the code is run under vxWorks. We were able to solve this problem with cfront by running the .o files through nm and munch, relinking that output to our original file, and inserting our own calls to _intialize_static_data() in our "main" program. We know that gcc-ld normally performs the corresponding functions for gnu g++, but when we compile for vxWorks rather than Unix, the initialization code is not generated. (We suspect it is suppressed by the -r option to the linker.) We have tried to compile the gnu collect.c program to perform this function, but we do not know how to define the assembly code macros it uses for our machine. Can anyone tell us how to solve this problem? Are we on the right track with collect, or are is there a certain combination of gcc-ld options that we should use? -- ---- Monica D. Skidmore monica@searchtech.com search technology, inc. emory!stiatl!srchtec!monica Atlanta, Georgia monica@srchtec.uucp