avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Is there a reason why avr-gcc does not support constr


From: David Fernandez
Subject: Re: [avr-gcc-list] Is there a reason why avr-gcc does not support constructor priority (both in C and C++ worlds)?
Date: Tue, 18 Mar 2014 17:51:48 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0


On 18/03/14 17:19, Senthil Kumar Selvaraj wrote:
On Tue, Mar 18, 2014 at 11:51:33AM +0000, David Fernandez wrote:
Hi there,

I've been trying to use both the attributes "init_priority" for C++, and
"constructor" for C, with priority numbers, in atxmega{16,32}a4u, and the
compiler complains saying "error: 'init_priority' attribute is not supported
on this platform", or "error: constructor priorities are not supported".
This features requires the target backend to opt in (by declaring
SUPPORTS_INIT_PRIORITY) to a non-zero value. The avr backend doesn't, even on
the latest sources, so newer versions don't have it either.

I checked out what the x86_64 target does with init_priority. It actually

* generates individual intitializer functions for each unique priority
* generates a .init_array.<priority> section for each unique priority
   and puts a pointer to the initializer function inside it.
* These input sections are sorted in the linker script with
SORT_BY_INIT_PRIORITY, instead of just SORT to so that the linker will
do a numerical sort on priority.

I don't see a reason to not support this though. Can you please file a
bug so we can track this?

Regards
Senthil
Sure. Could you tell me where? (e.g. bugzilla or any other bug tracking).

Regards
David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]