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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,69431b06fe9a3239 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: How do I disable elaboration code on this Date: Mon, 11 Apr 2011 07:28:14 +0100 Organization: A noiseless patient Spider Message-ID: References: <58bc4fb4-5f6a-48d6-9c98-0dde7ac619df@p16g2000vbo.googlegroups.com> <4da2176e$0$6977$9b4e6d93@newsspool4.arcor-online.net> <93b20b91-03ed-48d2-87b6-a109127a5a4f@l18g2000yql.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx03.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="17634"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19eqgheSNm53u3PdykJDC8lCi7A5/aolJE=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:/wSOT+nP354YjhMw2xLRilmVv/4= sha1:94iiPa0xVqmHybm8UXPvQeScldY= Xref: g2news2.google.com comp.lang.ada:19721 Date: 2011-04-11T07:28:14+01:00 List-Id: Lucretia writes: > Just to clarify, this vector is to be: > > 1) set up by the user > 2) gathered by the linker script and written out at the start of the > elf > 3) placed at address 0 in the elf > 4) made ROMable > > From your responses, it seems that you don't quite understand my aim > here, point 4 is the most important here, ROMable means, the compiler > must not under any circumstance create any elaboration code to > initialise the array and given that the array is 1) constant and 2) > has known contents, the compiler should be capable of this. Maybe GNAT > can't do it? Maybe Ada can't do it and actually is wrong for OS > development? Which I doubt otherwise, I may as well go create my own > strongly typed language for OS/embedded work? Please re-read this which I posted earlier (apologies if my news interface is failing. I did try mailing it.) Provided that the Cortex-M3 SDK ld has the ability to specify where a section should go, this will meet all your criteria except possibly (2) (which doesn't seem really necessary?) The SDK must have the ability to specify where sections should go, otherwise how is this exception vector set up from C or ASM? ------------------------------------------------------------------------ It's the fact that Vector is at 16#0000_0000# that's causing the problem (there is no elaboration code if the linker is allowed to put Vector where it likes). So clearly GNAT doesn't know how to make ld do what's wanted and has to do it the hard way. Is the missing bit perhaps the use of what on VAX used to be called program sections (PSECTs)? GNU ld includes the option --section-start sectionname=org Locate a section in the output file at the absolute address given by org. You may use this option as many times as necessary to locate multiple sections in the command line. org must be a single hexadecimal integer; for compatibility with other linkers, you may omit the leading 0x usually associated with hexadecimal values. so I suppose what's needed is a way to force Vector into a specific named section. What about pragma Linker_Section? http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gnat_rm/Pragma-Linker_005fSection.html I can't go much further here (what's legal as the name of a section depends on the assembler/linker conventions), but this pragma Linker_Section (Vector, "initial_isv,0"); (instead of "for Vector'Address") resulted in this .globl _isr__vector .section initial_isv .align 5 _isr__vector: .quad _isr__dummy .quad _isr__dummy .quad _isr__dummy .quad _isr__dummy .const (This is a 64-bit compiler, hence the .quad's. No idea about .align 5.)