[RFC/Patch] : Enable Dwarf2 unwind on cygwin and mingw32
Danny Smith
dannysmith@clear.net.nz
Wed Nov 24 22:47:00 GMT 2004
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
More information about the Gcc-patches
mailing list