This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC/Patch] : Enable Dwarf2 unwind on cygwin and mingw32
- From: Danny Smith <dannysmith at clear dot net dot nz>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 25 Nov 2004 10:54:45 +1300
- Subject: Re: [RFC/Patch] : Enable Dwarf2 unwind on cygwin and mingw32
- References: <20041124103059.1623.qmail@web50903.mail.yahoo.com><20041124192950.GD5809@redhat.com>
- Reply-to: Danny Smith <dannysmith at users dot sourceforge dot net>
Richard Henderson wrote:
> On Wed, Nov 24, 2004 at 11:30:59PM +1300, Danny Smith wrote:
>> It adds crtbegin.o and crtend.o as startfile/endfiles based on
>> crtstuff
>> code, but separated out for now to allow easier specialization for a
>> system that does not have .init/.fini sections.
>
> In theory, you shouldn't have to do this; these files should already
> work on systems without .init/.fini sections. What, specifically,
> did you run into?
The main problem was that I kept getting lost amongst all the ifdefs.
The only way I could get it to work was to define HAS_INIT_SECTION
whiched seemed likely to get me into trouble elsewhere.
>
>> + /* cygwin has its own version of __do_globl_{c,d}tors in
>> cygwin1.dll. These + could be changed to incorporate calls to
>> frame registry functions. + For now, just add a ctor and dtor to
>> be called by the libary code. + It does mean, however, that
>> linker scripts needs to be modified to ensure + ctor in this
>> endfile is always called before ctors with non-default + init
>> priority. */
>
> If you support init priorities, why not use them? Set the
> registration functions to the maximum prioirity. That plus link-line
> position is sufficient to ensure the proper invocation sequence.
>
Umm,
void my_ctor (void) __attribute__ ((constructor,
init_priority(MAX_INIT_PRIORITY)));
gets me:
error: can only use 'init_priority' attribute on file-scope definitions
of objects of class type
Are you suggesting that I write out the section directive in asm, rather
than use attributes?
Danny