comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: How can I get this data into the .data section of the binary?
Date: Sun, 21 Jun 2020 09:55:16 +0300	[thread overview]
Message-ID: <hl8eilFg3blU1@mid.individual.net> (raw)
In-Reply-To: <rcmlnr$er7$1@franka.jacob-sparre.dk>

On 2020-06-21 6:55, Randy Brukardt wrote:
> "Niklas Holsti" <niklas.holsti@tidorum.invalid> wrote in message
> news:hl0s14FsgcgU1@mid.individual.net...
>> On 2020-06-18 5:55, Randy Brukardt wrote:
> ...
>>> The better question is why you care?
>>
>>
>>     [snip]
>>
>>> (The situation can be different on a bare machine, of course.)
>>
>>
> ...
>> For my case of the large constant array, we needed to save RAM space, and
>> did not want to spend RAM _both_ for the elaboration code that initialized
>> the array (larger than the array itself) and for the array.
> 
> I suppose it would depend on the declaration of the array, but I would not
> expect that to be the case most of the time. Typically, one can initialize
> most Ada data types with a block-copy, which would only be a handful of
> bytes on most target machines.

I'm sure you are right, most of the time.

In our case, however, even if the compiler would have done a block-copy, 
the *source* of the block-copy would also have been in RAM because the 
*whole* SW image was copied at boot from EEPROM to RAM (as is ESA 
practice). So the RAM consumption of the array would still be at least 
twice the array size.

A block copy from EEPROM to RAM would have been ok, in principle, but in 
our case the compiler/linker knew nothing about the program's EEPROM 
residence. That was Boot SW business.

And if the compiler could have created the static source data for a 
block copy, it could as well have placed the whole load-time initialized 
array (a constant) in the read-only-data segment, which was what we 
wanted, and got in the end.

This was in the days when RAM in ESA on-board computers was expensive 
static RAM; nowadays it is usually dynamic RAM, I believe, and typical 
RAM size has gone up by one or two orders of magnitude.

-- 
Niklas Holsti
niklas holsti tidorum fi
       .      @       .

  reply	other threads:[~2020-06-21  6:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 11:31 How can I get this data into the .data section of the binary? Luke A. Guest
2020-06-16 11:37 ` Luke A. Guest
2020-06-16 11:50   ` J-P. Rosen
2020-06-16 12:36     ` Luke A. Guest
2020-06-16 12:45       ` Luke A. Guest
2020-06-16 12:56         ` J-P. Rosen
2020-06-16 12:59           ` Luke A. Guest
2020-06-16 13:29             ` J-P. Rosen
2020-06-16 13:44               ` Luke A. Guest
2020-06-18  2:55                 ` Randy Brukardt
2020-06-18  9:55                   ` Niklas Holsti
2020-06-21  3:55                     ` Randy Brukardt
2020-06-21  6:55                       ` Niklas Holsti [this message]
2020-06-16 13:52             ` Mark Lorenzen
2020-06-16 14:08               ` Luke A. Guest
2020-06-16 13:03           ` Luke A. Guest
2020-06-16 14:14 ` Niklas Holsti
2020-06-16 14:25   ` Dmitry A. Kazakov
2020-06-16 14:32     ` Niklas Holsti
2020-06-16 14:42     ` Luke A. Guest
2020-06-16 15:21       ` Dmitry A. Kazakov
2020-06-16 15:43         ` Luke A. Guest
2020-06-16 16:11           ` Dmitry A. Kazakov
2020-06-16 14:40   ` Luke A. Guest
2020-06-16 18:19 ` Tero Koskinen
2020-06-17 12:37   ` Luke A. Guest
2020-06-17 14:01     ` Niklas Holsti
2020-06-17 15:17       ` Luke A. Guest
2020-09-03 10:32 ` c+
2020-09-13 13:36 ` patelchetan1111992
2020-09-19 14:08 ` erchetan33
2020-09-28 11:36 ` yhumina stir
replies disabled

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