On Thu, Aug 18, 2011 at 2:15 PM, Richard Henderson <r...@redhat.com> wrote: > 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.
Oh!, right, sorry. So, the only available option now is to mark it as a constructor in libgcc. Thanks. -Sri. > > > r~ >