Static symbols in libgcc
Jeffrey A Law
law@unknown
Tue Jan 20 10:07:00 GMT 1998
I've been reviewing the libgcc discussion re: static variables.
First, yes, this is a significant problem.
Creating a shared libgcc or an additional shared library to
link into executables which contains the static variables isn't
the right thing to do. We've already been through the pain of
a shared libgcc once; I don't think we want to do it again.
This implies one of a few directions:
1. Eliminate the need for these static variables. However,
considering how they're used I doubt it's possible.
2. Move them into libstdc++. Shouldn't this just involve moving
some functions into libstdc++? Or to put it another way is
there some compelling reason to have these functions in libgcc?
3. Declare them in such a way as to only get one copy; instead of
a static, can it be a global (yes, there's a namespace pollution
issue, but it's worth thinking about). It could even possibly
be made weak global if that helps.
How many of these variables do we have? Maybe put them into a single
data structure to avoid polluting the namespace any more than is absolutely
necessary.
4. Or have a global pointer to a runtime initialized data structure
which has the stuff we need. We have the capability to initialize
stuff at program startup, so it shouldn't be that much of a stretch
to use it for this purpose.
On the GOT pointer issue; I don't know AIX well, but it seems to me
that we could just put the values we need into our builtin setjmp
frame. The other possibility is that the value is sitting in the
stack (this is how HPUX works).
Jeff
More information about the Gcc
mailing list