This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: const volatile behaviour change in GCC 7
- From: Sergey Organov <sorganov at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Date: Thu, 22 Sep 2016 20:18:43 +0300
- Subject: Re: const volatile behaviour change in GCC 7
- Authentication-results: sourceware.org; auth=none
- References: <57E386D5.1040708@embedded-brains.de> <ns0hq3$djv$1@blaine.gmane.org> <57E3D0BA.5090601@embedded-brains.de>
Sebastian Huber <sebastian.huber@embedded-brains.de> writes:
> On 22/09/16 14:11, Sergey Organov wrote:
>> Sebastian Huber <sebastian.huber@embedded-brains.de> writes:
>>> Hello,
[...]
>> Alternatively, try (untested, and I removed attributes to make my point
>> clearer):
>>
>> /* Linker-defined symbols */
>>
>> rtems_sysinit_item const _Linker_set__Sysinit_begin[0]
>> __attribute__((__section__(".rtemsroset." "_Sysinit" ".begin")))
>> __attribute__((__used__));
>>
>> rtems_sysinit_item const _Linker_set__Sysinit_end[0]
>> __attribute__((__section__(".rtemsroset." "_Sysinit" ".end")))
>> __attribute__((__used__));
>>
>> /* Get volatile pointers to the above */
>> static rtems_sysinit_item const *volatile begin_ = _Linker_set__Sysinit_begin;
>> static rtems_sysinit_item const *volatile end_ = _Linker_set__Sysinit_end;
>>
>> void rtems_initialize_executive(void)
>> {
>> rtems_sysinit_item const *cur = begin_;
>> rtems_sysinit_item const *end = end_;
>>
>> while(cur != end) {
>> cur->handler();
>> ++cur;
>> }
>> }
>>
>>
>
> I don't want any storage for these begin/end markers.
Why? 8 more bytes in context of RTEMS? It likely doesn't matter. At all.
-- Sergey