Location of constructor and destructor stabs

Marc Espie espie@quatramaran.ens.fr
Tue Nov 24 20:53:00 GMT 1998

In article < 199811241851.NAA14859@portnoy.MIT.EDU > you write:

>I'm not sure whether this is a bug or not...

>I noticed an odd difference between how GCC 2.7 and egcs output linker
>set symbols for global constructors and destructors.  This is only
>tested on i386--netbsd, but presumably affects other a.out platforms
>as well.

I've stumbled into the same problem a few weeks ago, I even reported it
to this list.  It took me quite a while to figure out what happened.

>In GCC 2.7, the set symbol is always output just after the end of the
>function.  egcs has the same behaviour with optimize<3, but with
>optimize>=3 it outputs the set symbol before the function definition.

>I noticed this because our version of gas handled forward references
>in set symbols rather poorly.  I've fixed the gas bug, but I thought
>I'd mention it here in case the egcs behaviour is considered broken.

I'd consider this to be at least half a bug.

I'm an OpenBSD guy, but we're probably using very similar versions
of gas.  This email is Cc:ed to egcs-bugs, as this ties two bug-reports
together, but could you please contact me privately---I'm very interested 
in comparing notes, and possibly getting together a patch to gas that 
would solve this specific problem.

More information about the Gcc-bugs mailing list