This is the mail archive of the
mailing list for the GCC project.
Re: GLOBAL constructor symbol names for static vars are bogus!
- To: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Subject: Re: GLOBAL constructor symbol names for static vars are bogus!
- From: "Brad M. Garcia" <bgarcia at fore dot com>
- Date: Thu, 12 Mar 1998 07:46:13 -0500 (EST)
- cc: egcs-bugs at cygnus dot com
- Reply-To: "Brad M. Garcia" <bgarcia at fore dot com>
On Wed, 11 Mar 1998, Martin von Loewis wrote:
> > However, most file names contain periods (ex - "foo.cc"). If I want
> > to call one of these constructors myself (which I need to do in
> > VxWorks, for example), gcc chokes on the name of the function because
> > it contains a period.
> Do you really need to call those yourself? Normally, you could have
> collect2 go over all the files and produce __main (or the like),
> which you then can call. Why doesn't this work?
Right now, I'm using munch (a program that VxWorks distributes) to gather
all the global constructors _and_ destructors and place them into two
arrays in a C file which can then be compiled and linked with everything
else. These two arrays are known to the VxWorks run-time linker, which
will then call every function within them when loading or unloading a
I am not very familiar with how collect2 works. Could you explain to
me how I could invoke it to do something similar to what I described
above? Remember, all my linking is relocatable - I do not produce
any actual "programs".
> > Can the names for these global constructors be "mangled" differently,
> > or is there a way to get gcc to recognize the symbol in it's entirety,
> > even though it contains periods?
> If you really need to call it from source code, I assume you can use
> inline assembly to do so. Another option is to define NO_DOT_IN_LABEL
> for your target, in which case the period is replaced with an underscore.
I guess that requires me to recompile egcs. I may just have to do that.
___/ __ / __ / ___/ "Being the Linux of digital media
__/ / / / _/ __/ would be a very good life."
_/ ____/ _/ _| ____/ - Jean-Louis Gassee, CEO of Be, Inc.