From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: How can I get this data into the .data section of the binary? Date: Tue, 16 Jun 2020 17:32:00 +0300 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net +O6RuJ/RDrOrIpkrJ58xZgnM1GJz/5nyddVrxC3Z1rBU3GhHMJ Cancel-Lock: sha1:h5D+86eYMOvU8GgbuwoLnNA5KJQ= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:59095 List-Id: On 2020-06-16 17:25, Dmitry A. Kazakov wrote: > On 16/06/2020 16:14, Niklas Holsti wrote: >> On 2020-06-16 14:31, Luke A. Guest wrote: > >>> 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)); >> >> 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"). > > That is interesting. Was there the "others =>" part? I don't remember for sure, but I think not. As I said, the types were much simpler. IIRC, the array elements were System.Address, and the index was an integer range. The array mapped the identifiers of the (many!) commandable/settable program "parameters" to their memory locations. -- Niklas Holsti niklas holsti tidorum fi . @ .