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,55a8252137b5ef97 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!proxad.net!62.253.162.218.MISMATCH!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!newspeer1-win.ntli.net!newsfe1-gui.ntli.net.POSTED!53ab2750!not-for-mail From: "Dr. Adrian Wrigley" Subject: Re: Efficiently setting up large quantities of constant data User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.ada References: <2508656.W3VlADmtU1@jellix.jlfencey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Thu, 16 Dec 2004 18:12:19 GMT NNTP-Posting-Host: 81.100.88.147 X-Complaints-To: http://www.ntlworld.com/netreport X-Trace: newsfe1-gui.ntli.net 1103220739 81.100.88.147 (Thu, 16 Dec 2004 18:12:19 GMT) NNTP-Posting-Date: Thu, 16 Dec 2004 18:12:19 GMT Organization: ntl Cablemodem News Service Xref: g2news1.google.com comp.lang.ada:6997 Date: 2004-12-16T18:12:19+00:00 List-Id: On Thu, 16 Dec 2004 14:24:01 +0000, Vinzent 'Gadget' Hoefler wrote: > Dr. Adrian Wrigley wrote: > >> I presume this needs to be done at the linker stage, but I don't >> see any options to link in non-object files. > > You could give "objcopy" a try. It can convert a binary file into an > object file which could then be linked normally. This is exactly what I've been looking for! Thanks! It gives the necessary symbols to access the data from Ada with a pragma import, AFAICT. It looks like the equivalent on Windows is to use a Resource Compiler. Getting a "constant" view of the data from Ada should be simple (but I haven't tested it). (extract of objcopy man page on Linux): --binary-architecture=bfdarch Useful when transforming a raw binary input file into an object file. In this case the output architecture can be set to bfdarch. This option will be ignored if the input file has a known bfdarch. You can access this binary data inside a program by referencing the special symbols that are created by the conversion process. These symbols are called _binary_objfile_start, _binary_objfile_end and _binary_objfile_size. e.g. you can transform a picture file into an object file and then access it in your code using these symbols. -- Adrian