[K42-discussion] Cause of cxa_atexit/dso_handle reference

Patrick G. Bridges bridges at cs.unm.edu
Tue Aug 29 04:52:20 EST 2006


On Aug 28, 2006, at 12:28 PM, Bryan S Rosenburg wrote:
>
> I'm ready to give up on this battle and go with an empty cxa_atexit.
>
> But I don't think there's any way the compiler can generate code  
> that makes an exit-time call to a destructor for an object that is  
> merely referenced by a global variable.  How could the compiler  
> possibly know that the object still exists when the program exits?
> I think the calls to cxa_atexit in your test program result from  
> the use of <iostream> and cout.

Hmm, you may be right. That does indeed look to be the case.

> As I said, I'm willing to give up on eliminating global objects.   
> I'd be happier, though, if we at least knew the magnitude of the  
> problem.  How many object files in the build tree have references  
> to cxa_atexit?

Donour's in the process of collecting this, and should have it for us  
soon.

-Patrick



More information about the K42-discussion mailing list