This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 1008 segfaults in genattr
- To: acs at acm dot org
- Subject: Re: 1008 segfaults in genattr
- From: hjl at lucon dot org (H.J. Lu)
- Date: Mon, 17 Nov 1997 11:15:41 -0800 (PST)
- Cc: robertl at dgii dot com, law at cygnus dot com, egcs at cygnus dot com
>
>
> 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.