comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP>
Subject: Re: How do I disable elaboration code on this
Date: Mon, 11 Apr 2011 11:59:03 +0000 (UTC)
Date: 2011-04-11T11:59:03+00:00	[thread overview]
Message-ID: <inuqe6$rs2$1@dont-email.me> (raw)
In-Reply-To: m2mxjxrtcu.fsf@pushface.org

On 2011-04-11, Simon Wright <simon@pushface.org> wrote:
> Lucretia <Lucretia9000@yahoo.co.uk> writes:
>
>> The problem has nothing to do with the linker, I'm using binutils and
>> gnat that I'e built myself. The problem is that GNAT is generating
>> elaboration code where it is not allowed, i.e. code that 1)
>> initialises  the array to 0 and 2) code that the copies function
>> addresses into the array.
>>
>> If this cannot work then I'm surprised and I'll be forced to use
>> separate constants as noted by Rolf. It just seems like overkill
>> having to specify each element separately when an array is the right
>> structure ffor the job.
>>
>> And in other languages like C it doesn't do the same thing. You can
>> specify a static constant array and it'll initialise it with the right
>> data.
>
> And can you also specify the load address?
>

On Cortex M3 devices using C, this array is placed in it's own section
and is placed at address 0 by the linker script.

The issue here is that when the Cortex M3 comes out of reset it reads,
and loads, the stack pointer from the first longword in that array
and then jumps to the address specified by the second longword.

To Luke: are you targetting only the Cortex M3 or traditional ARM7
devices as well ?

If you are targetting the latter as well, you may wish to think about
just using a wrapper as you would need to have assembly wrappers anyway
for the ARM7 device. (For anyone here unfamiliar with ARM7 devices, when
traditional ARM7 devices come out of reset, you cannot even run C code
until you have setup a SP in the startup code).

Simon.

-- 
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world



  reply	other threads:[~2011-04-11 11:59 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-09 13:58 How do I disable elaboration code on this Lucretia
2011-04-09 16:57 ` Jeffrey Carter
2011-04-09 17:01   ` Simon Wright
2011-04-09 17:44     ` Ludovic Brenta
2011-04-09 19:19       ` Simon Wright
2011-04-09 19:32         ` Jeffrey Carter
2011-04-10  9:06           ` Lucretia
2011-04-10  9:31             ` Simon Wright
2011-04-09 19:35         ` Ludovic Brenta
2011-04-09 22:05           ` Simon Wright
2011-04-10  5:39             ` Simon Wright
2011-04-10 17:20   ` Lucretia
2011-04-10 20:12     ` Jeffrey Carter
2011-04-10 20:47     ` Georg Bauhaus
2011-04-10 21:19       ` Lucretia
2011-04-11  5:08         ` Lucretia
2011-04-11  6:28           ` Simon Wright
2011-04-11  8:54             ` Lucretia
2011-04-11 10:10               ` Simon Wright
2011-04-11 11:59                 ` Simon Clubley [this message]
2011-04-11 18:30                   ` Simon Wright
2011-04-11 19:12                     ` Simon Wright
2011-04-11 19:50                       ` Simon Wright
2011-04-11 21:40                       ` Lucretia
2011-04-11 23:12                         ` Lucretia
2011-04-11 23:16                           ` Lucretia
2011-04-11 23:31                           ` Lucretia
2011-04-12  5:22                             ` Simon Wright
2011-04-12 17:07                             ` Simon Clubley
2011-04-13 16:53                       ` Simon Wright
2011-04-15  8:38                       ` Simon Wright
2011-04-11 23:08                   ` Lucretia
2011-04-12 11:50                     ` Simon Clubley
2011-04-12 16:48                       ` Lucretia
2011-04-11 11:19               ` Georg Bauhaus
2011-04-11 13:50                 ` Simon Wright
2011-04-14 19:19               ` Florian Weimer
2011-04-10 16:34 ` Rolf
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox