1008 segfaults in genattr

H.J. Lu hjl@lucon.org
Mon Nov 17 11:19:00 GMT 1997


> 
> 
> robertl@dgii.com said:
> >   What's the simplest program you can provide that shows the problem?
> 
> >From memory:
> 
> #include <stdio.h>
> main()
> {
> 	printf("Hello World\n");
> }
> 
> 
> This dumps core in (stop me if you've heard this before) 
> __do_global_dtors_aux, the 2nd time around.
> 

Why is __do_global_dtors_aux () called twice? If I remembered
right, it was designed with ELF in mind. It is stuck into the
.fini section through some magic. It should only be called
exactly once. That is how the .fini section should work any
way. Now if SCO uses a different scheme for __do_global_dtors_aux (),
there is no guarantee that it will work at all.

BTW, my ELF paper describes how it works:

ftp://sunsite.unc.edu/pub/Linux/GCC/elf.ps.gz

If SCO uses the same magic and it doesn't work, please drop
me a line. I will take a look.

BTW, all those stuffs assume you have an ELF linker which
does the right thing.


H.J.



More information about the Gcc mailing list