This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

[PATCH,target]AVR - disable constructor init priorities


Anatoly,

Init priorities allows the order of constructor/destructors to be controlled. This is not supported by the AVR code (it would need to use named sections with linker support).

So we accept

   void d1() __attribute__((destructor (100)));
   void d2() __attribute__((destructor (600)));
   void d3() __attribute__((destructor (400)));

and produce wrong code, as destructors and constructor will be applied in arbitrary order without warning.

Patch sets support flag *SUPPORTS_INIT_PRIORITY *to zero, so that the above will cause error:

"constructor priorities are not supported"

Plain contrsuctors/destructors are unaffected - for example:

void c1() __attribute__((constructor ()));

Tested on 4.4 HEAD. Ok for mainline ?


2008-06-15 Andy Hutchinson <hutchinsonandy@aim.com>


* config/avr/avr.h (*SUPPORTS_INIT_PRIORITY): Define.


*

Attachment: ctor.patch
Description: Text document


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