comp.lang.ada
 help / color / mirror / Atom feed
From: "Doobs" <doobs@doobs.com>
Subject: Re: Any way of persuading GNAT/GCC to implement a true overlay and not a pointer?
Date: Sat, 1 Apr 2006 17:52:46 +0100
Date: 2006-04-01T17:52:46+01:00	[thread overview]
Message-ID: <t_KdnZ_-_5pGMrPZRVnyrA@pipex.net> (raw)
In-Reply-To: fif2g3-a7j.ln1@newserver.thecreems.com


">> I was under the impression that code of the following form :
>>
>> X : <Some Type>;
>> Y : <Some Type>;
>> for Y'Address use X'Address;
>>
>> would result in an overlay in the resulting code.

>>
>
> Try applying pragma volatile to both declarations. Also for completeness 
> you should add a pragma import to Y to avoid any default initialization.
>
> There is an AI that talks (to some exent) to this issue.
>
> I am not entirely sure that the volatile will fix your problem because I 
> don't quite get what the resulting behaviour is that you are seeing/not 
> seeing.

Tried Pragma volatile - had no effect.....

What I am seeing is that in the map file X and Y are located at different 
addresses.  Even though Y is a large array in my implementation, the linker 
has only reserved four bytes for it.  When examining the contents of Y at 
run time it contains the address of X - i.e. it is a pointer to X

What I actually want is that Y and X are physically located at the same 
address (i.e. a true overlay) so that test equipment that uses the symbol 
table to resolve data can look at X and resolve the contents as one data 
type or look at Y and resolve the contents as another - but they are 
physically reading the same memory.  I dont want the run-time overhead of 
copying the contents via unchecked conversion to another data type.





  reply	other threads:[~2006-04-01 16:52 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-01 13:47 Any way of persuading GNAT/GCC to implement a true overlay and not a pointer? Doobs
2006-04-01 14:33 ` Jeffrey Creem
2006-04-01 16:52   ` Doobs [this message]
2006-04-01 17:56     ` Martin Krischik
2006-04-01 18:04     ` Dmitry A. Kazakov
2006-04-01 17:08 ` Florian Weimer
2006-04-01 17:54   ` Doobs
2006-04-01 18:19     ` Doobs
2006-04-01 20:01       ` Jeffrey Creem
2006-04-01 21:33         ` Doobs
2006-04-03 12:25           ` Gerd
2006-04-01 20:57       ` Dmitry A. Kazakov
2006-04-04  1:23 ` Randy Brukardt
2006-04-10  1:42   ` Justin Gombos
2006-04-10 20:12     ` Randy Brukardt
2006-04-11 13:54       ` Making money on open source, if not by selling _support_, then how? Marc A. Criley
2006-04-11 15:13         ` Justin Gombos
2006-04-11 16:22           ` Dmitry A. Kazakov
2006-04-11 17:56             ` Justin Gombos
2006-04-11 18:38               ` Georg Bauhaus
2006-04-12 13:59                 ` Justin Gombos
2006-04-12 14:39                   ` Georg Bauhaus
2006-04-15 19:33                     ` Justin Gombos
2006-04-12 17:07                   ` Larry Kilgallen
2006-04-13  3:16                     ` Justin Gombos
2006-04-11 19:59               ` Randy Brukardt
2006-04-11 20:18                 ` Ed Falis
2006-04-12 14:10                 ` Justin Gombos
2006-04-12 20:57                   ` Randy Brukardt
2006-04-15 20:37                     ` Justin Gombos
2006-04-18  0:24                       ` Randy Brukardt
2006-04-18 16:02                         ` Justin Gombos
2006-04-12 19:27                 ` Martin Dowie
2006-04-12  8:32               ` Dmitry A. Kazakov
2006-04-12 11:23                 ` Georg Bauhaus
2006-04-12 15:34                   ` Dmitry A. Kazakov
2006-04-12 17:11                     ` Georg Bauhaus
2006-04-12 19:37                       ` Dmitry A. Kazakov
2006-04-12 21:56                         ` Georg Bauhaus
2006-04-13  9:17                           ` Dmitry A. Kazakov
2006-04-13 14:18                             ` Georg Bauhaus
2006-04-14 10:01                               ` Dmitry A. Kazakov
2006-04-14 12:55                                 ` Georg Bauhaus
2006-04-15 10:13                                   ` Dmitry A. Kazakov
2006-04-15 18:07                                     ` Georg Bauhaus
2006-04-13  2:58                 ` Justin Gombos
2006-04-13  9:17                   ` Dmitry A. Kazakov
2006-04-15 21:17                     ` Justin Gombos
2006-04-16 10:53                       ` Dmitry A. Kazakov
2006-04-16 13:03                         ` Georg Bauhaus
2006-04-16 17:59                           ` Dmitry A. Kazakov
2006-04-16 20:53                             ` Georg Bauhaus
2006-04-17  9:16                               ` Dmitry A. Kazakov
2006-04-19 20:38                                 ` Justin Gombos
2006-04-20 18:01                                   ` Dmitry A. Kazakov
2006-04-18  0:29                             ` Randy Brukardt
2006-04-16 14:55                         ` Justin Gombos
2006-04-16 17:59                           ` Dmitry A. Kazakov
2006-04-19 18:17                             ` Justin Gombos
2006-04-20 18:07                               ` Dmitry A. Kazakov
2006-04-11 15:34         ` Justin Gombos
2006-04-12  2:59         ` Steve
2006-04-13  7:41         ` Jean-Pierre Rosen
2006-04-13 13:18           ` Marc A. Criley
2006-04-13 13:35             ` Dmitry A. Kazakov
2006-04-13 13:57             ` Making money on open source, if not by selling _support_, then Larry Kilgallen
2006-04-13 19:37               ` Justin Gombos
2006-04-13 21:02                 ` Larry Kilgallen
2006-04-14  2:49                   ` Justin Gombos
replies disabled

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