From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: How do package body initializers get run in GNU Ada?
Date: Sat, 02 Nov 2002 01:23:34 GMT
Date: 2002-11-02T01:23:34+00:00 [thread overview]
Message-ID: <3DC3293C.8040104@acm.org> (raw)
In-Reply-To: 3DC31EBB.2050809@math.jpl.nasa.gov
Van Snyder wrote:
>
> In GNU Ada, what mechanism is used to cause execution of package
> body initializers, i.e., the code between begin and end in a
> package body?
You can find the answer to your question by reading the GNAT sources.
>
> Is it done using some kind of back-patching/overlaying done
> by an otherwise garden-variety ld, by special features added
> to ld to support Ada, by first-time flags at the entries
> to procedures, or by something else?
You will find that the binding process (gnatbind) builds the main
program, which makes a call or calls to execute such code before calling
your main procedure. By reading the secret GNAT documentation you can
find the option that keeps the source of this main program instead of
deleting it after the executable is written. You could then look at the
main program and see what it calls to effect elaboration.
--
Jeff Carter
"I fart in your general direction."
Monty Python & the Holy Grail
next prev parent reply other threads:[~2002-11-02 1:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-02 0:39 How do package body initializers get run in GNU Ada? Van Snyder
2002-11-02 1:23 ` Jeffrey Carter [this message]
2002-11-02 1:28 ` sk
2002-11-04 15:20 ` Stephen Leake
2002-11-05 1:03 ` sk
2002-11-02 16:00 ` Robert A Duff
2002-11-03 2:45 ` David Marceau
2002-11-03 11:37 ` Romanov
2002-11-03 20:14 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox