comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos" <david.c.hoos.sr@ada95.com>
Subject: Re: GNAT internals question
Date: Wed, 26 Jun 2002 16:47:15 -0500
Date: 2002-06-26T16:47:15-05:00	[thread overview]
Message-ID: <mailman.1025128082.25766.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: 3D1A2EE9.5BC51A23@myob.com

Hi,

I don't believe ada_main___elabb will ever be called because the
basic structure of the Ada_Main packages is constrolled by the binder,
and the generated code (purposely, I believe) doesn't need any
elaboration code.  If there were any elaboration code generated, it
would need to be called _before_ adainit, given the rule that elaboration
of a package must be done before any of the package's subprograms
is called.

The elaboration code for all programmer-generated code is called by
adainit, so anything that the programmer can do to affect what is in the
Ada_Main package is confined to the elaboration procedures called by
adainit.

The only initialization of data items in the Ada_Main package is done
by means of literals -- i.e., no subprogram is called to do any of the
initialization -- hence, the initialization is accomplished by the
generation
of an initialized data section within the object file.

Am I making this clear?

----- Original Message -----
From: "sk" <noname@myob.com>
To: <comp.lang.ada@ada.eu.org>
Sent: Wednesday, June 26, 2002 4:15 PM
Subject: Re: GNAT internals question


> Hi,
>
> "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
> > ... not a single instance of ada_main___elabs.
>
> Sorry, I mis-remembered, it is "ada_main___elabb"
> I am refering to.
>
> So far my experience is also that it is not called
> but that doesn't mean that it never is used.
>
> It is difficult for me to describe what I am asking,
> but ...
>
> procedure Nothing is
> begin
>     null;
> end Nothing;
>
> The pragmas are to remove all external references
> and dependencies on the GNAT runtime.
>
> Linux shell commands :
>
>     gnatmake -c -v nothing
>     gnatbind -v nothing
>     gcc -v -c -S b~nothing.adb
>
> producing "b~nothing.s" which contains the elusive
> "ada_main___elabb" (AMEB an acceptable acronym ?).
>
> The GNAT Ada main function has a structure of
>
>     adainit
>     call nothing
>     adafinal
>
> I believe that when circumstances require, AMEB will
> both contain useful code and be called as part of the
> final binary.
>
> Isolating where it is called from is my goal. Prior to
> "adainit", from "adainit" or between "adainit" and the
> nothing call etc.
>
> AMEB might be a permanent and "legacy" stub, but I doubt
> it. I suspect that some features of Ada and GNAT will
> populate this function with useful code and call it when
> necessary.
>
> Trying to discover the circumstances.
>
> Thanks :-)
>
> --
> -------------------------------------
> -- Merge vertically for real address
> -------------------------------------
> s n p @ t . o
>  k i e k c c m
> -------------------------------------
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>




  parent reply	other threads:[~2002-06-26 21:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3D19AA89.8FAE0ECA@ktc.com>
2002-06-26 13:07 ` GNAT internals question David C. Hoos, Sr.
     [not found] ` <08c501c21d12$82b87a20$6400000a@dhoos>
2002-06-26 21:15   ` sk
     [not found]   ` <3D1A2EE9.5BC51A23@myob.com>
2002-06-26 21:36     ` sk
2002-06-26 21:47     ` David C. Hoos [this message]
2002-06-26 22:28     ` sk
     [not found]     ` <3D1A400A.D0DC919A@myob.com>
2002-06-27  3:02       ` David C. Hoos, Sr.
     [not found]       ` <099a01c21d87$2867b1b0$6400000a@dhoos>
2002-06-27  6:40         ` sk
2002-06-26 11:50 sk
2002-06-26 15:15 ` Stephen Leake
2002-06-26 21:21   ` sk
replies disabled

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