From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,afb4d45672b1e262 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.pipex.net!news.pipex.net.POSTED!not-for-mail NNTP-Posting-Date: Sat, 01 Apr 2006 10:52:43 -0600 Reply-To: "Doobs" From: "Doobs" Newsgroups: comp.lang.ada References: 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 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Response Message-ID: NNTP-Posting-Host: 85.210.60.99 X-Trace: sv3-UpCE9/d/88WqfROSPXqMCVRMYlRwN+/xn0lLSez6lEjCaupvQnqBbVSClJ7IokqKnkfR/C3jvPpgodH!LeURPO16hGKb4x74Th81JegnpEG+MmiX+9r9QvOUXNXU+oR7TZ8uhBtlN4iMCfMQVH+iZYvH7cFP!lb33b8LSNg== X-Complaints-To: abuse@dsl.pipex.net X-DMCA-Complaints-To: abuse@dsl.pipex.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:3697 Date: 2006-04-01T17:52:46+01:00 List-Id: ">> I was under the impression that code of the following form : >> >> X : ; >> Y : ; >> 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.