comp.lang.ada
 help / color / mirror / Atom feed
From: "Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk>
Subject: Re: Efficiently setting up large quantities of constant data
Date: Thu, 16 Dec 2004 18:12:19 GMT
Date: 2004-12-16T18:12:19+00:00	[thread overview]
Message-ID: <pan.2004.12.16.18.12.25.751182@linuxchip.demon.co.uk.uk.uk> (raw)
In-Reply-To: 2508656.W3VlADmtU1@jellix.jlfencey.com

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




  reply	other threads:[~2004-12-16 18:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-13 21:48 Efficiently setting up large quantities of constant data Michael Mounteney
2004-12-13 22:09 ` Stephen Leake
2004-12-13 22:15 ` Luke A. Guest
2004-12-14  0:20 ` Jeffrey Carter
2004-12-14  8:43 ` Martin Krischik
2004-12-14 12:18 ` Simon Wright
2004-12-15 21:10   ` Brian May
2004-12-16 23:18     ` Nick Roberts
2004-12-16 12:36 ` Dr. Adrian Wrigley
2004-12-16 13:50   ` Marc A. Criley
2004-12-17  2:32     ` John B. Matthews
2004-12-16 14:06   ` rien
2004-12-16 14:24   ` Vinzent 'Gadget' Hoefler
2004-12-16 18:12     ` Dr. Adrian Wrigley [this message]
2004-12-16 23:25       ` Nick Roberts
2004-12-17  5:20     ` tmoran
2004-12-17  8:38       ` Vinzent 'Gadget' Hoefler
2004-12-17 13:53     ` Dr. Adrian Wrigley
2004-12-17 14:16       ` Alex R. Mosteo
2004-12-16 17:11   ` Andre
2004-12-16 21:52     ` Larry Kilgallen
2004-12-16 23:23       ` Nick Roberts
2004-12-16 23:47       ` Dr. Adrian Wrigley
2004-12-19 14:34         ` Simon Wright
2004-12-16 18:29 ` Alex R. Mosteo
replies disabled

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