ordering of constructors
Neal Becker
ndbecker2@verizon.net
Fri Apr 9 12:57:00 GMT 2004
Hi. I'm trying to port CLN-1.1.6 to x86_64. Currently it segfaults on all
tests. The problem appears to be some asm code whose purpose is to make
sure global constructors are ordered.
I'm not that familiar yet with this code, but I think the way it is used is
that if a file F.cc needs a global object A, and A requires B, then a macro
is used to ensure the constructor for B was called before A.
I'm wondering if there are cleaner/non-asm techniques available,
particularly on modern gcc/binutils to address this?
I'm looking at 'init-priority'. It may be possible to use this.
I'm thinking the dependencies can be put in a tree. If the tree can be
mapped to a linear list, then init-priority could theoretically do this.
I suppose some kind of utility would need to be written to do this? Perhaps
something already exists?
More information about the Gcc
mailing list