This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 1008 segfaults in genattr


> 
> 
> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]