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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9481a69308ab1362 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-07 23:34:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!freenix!enst!enst.fr!not-for-mail From: sk Newsgroups: comp.lang.ada Subject: Re: assembly generated using gcc -S on a .adb Date: Mon, 08 Jul 2002 01:31:10 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1026110042 37297 137.194.161.2 (8 Jul 2002 06:34:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 8 Jul 2002 06:34:02 +0000 (UTC) Return-Path: X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19-4.3mdk i686) X-Accept-Language: en Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:26934 Date: 2002-07-08T01:31:10-05:00 Hi, > /usr/lib/crt1.o: In function `_start': > /usr/lib/crt1.o(.text+0x18): undefined reference to `main' If you can find and look at the 'specs' file for the linker, you will see that "/usr/lib/crt1.o" is automatically part of any (standard) executable you create. This file provides a function "_start" which the linker, unless specifically overridden, assumes is the entry point for the final executable. The "_start" typically does some setup and then calls "main". There is a direct correlation between this "main" and the typical "C" executable "int main (argc ...)". As J.Carter notes, look at the GNAT users manual to see how the "main" is generated by the GNAT compilation process. > I realize that gcc *is* a c compiler ... Not really. gcc coordinates the language specific front ends, the code generation and linking. > In other words, is there a way for a machine with just gcc > installed, to produce an executable from an asm file that was > generated from an .adb ?? Yes, but as with any programming language, you need to have all external references resolvable at link time. Your provided example would suggest that this implies you need to supply "main" and keep hacking until there are no unresolved references. -- ------------------------------------- -- Merge vertically for real address ------------------------------------- s n p @ t . o k i e k c c m -------------------------------------