[PATCH,target]PING AVR - disable constructor init priorities

Andy H hutchinsonandy@aim.com
Sun Jun 22 17:14:00 GMT 2008


Anatoly, this still needs your approval.

Andy H wrote:
> 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.
>
>
> *



More information about the Gcc-patches mailing list