On 08/18/2011 10:25 AM, Sriraman Tallam wrote: > Ok, so two things. I create the constructor as a comdat. So, it is > created by gcc in every module but at link time only one copy will be > kept. So, it is going to be called only once and that is not a > problem.
Err, no. You'll wind up with one copy of the constructor which will be called N times. The comdat applies to the function body, not the data in the .ctors section. r~