comp.lang.ada
 help / color / mirror / Atom feed
From: "Luke A. Guest" <laguest@archeia.com>
Subject: Re: How can I get this data into the .data section of the binary?
Date: Tue, 16 Jun 2020 15:40:18 +0100	[thread overview]
Message-ID: <rcallt$67r$1@gioia.aioe.org> (raw)
In-Reply-To: hks2d9Fsa5jU1@mid.individual.net

On 16/06/2020 15:14, Niklas Holsti wrote:
> On 2020-06-16 14:31, Luke A. Guest wrote:
>> Hi,
>>
>> I'm trying to get some static data tables into the data section rather
>> than be elaborated at runtime. I can see no reason why this particular
>> set of types, records and aggregates cannot go into the data section.
> 
>    [snip]
> 
>>     Pixel_Format_Unknown     : constant Pixel_Format_Names :=
>>       Pixel_Format_Names'(Planar        => True,
>>                           Planar_Format => Planar_Pixels'
>>                             (others => Ada.Characters.Latin_1.NUL));

Strangely enough, with preelaborate, that's the only one which gets put
into rodata:

Disassembly of section
.rodata.sdl__video__pixel_formats__pixel_format_unknown:

0000000000000000 <sdl__video__pixel_formats__pixel_format_unknown>:
   sdl__video__pixel_formats__pixel_format_unknown : constant
   0:   00 00                   add    %al,(%rax)
        ...

Disassembly of section .bss.sdl__video__pixel_formats__A44s:

0000000000000000 <sdl__video__pixel_formats__A44s>:
   0:   00 00                   add    %al,(%rax)
        ...

Disassembly of section
.bss.sdl__video__pixel_formats__pixel_format_index_1_lsb:

0000000000000000 <sdl__video__pixel_formats__pixel_format_index_1_lsb>:
   sdl__video__pixel_formats__pixel_format_index_1_lsb : constant
   0:   00 00                   add    %al,(%rax)

> Several years ago we had a problem like this, with a large constant
> array that we wanted to have only once in RAM. This was with the XGC Ada
> compiler, but there we found a work-around: using positional rather than
> named association for the large array aggregate.
> 
> I have no idea if this will help you -- the types in our case were much
> simpler -- but you might try it with a small subset of your package:
> 
>    Pixel_Format_Unknown     : constant Pixel_Format_Names :=
>      (True, (NUL, NUL, NUL, NUL));
> 
> (assuming "use Ada.Characters.Latin_1").
> 

Nope, that doesn't work.

  parent reply	other threads:[~2020-06-16 14:40 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
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 [this message]
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