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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8753ab815369efb9,start X-Google-Attributes: gid103376,public From: aklee@no_spam.bonsai.net (Albert K. Lee) Subject: Ada + Assembly ... Date: 1997/06/20 Message-ID: #1/1 X-Deja-AN: 251278070 Organization: The Bonsai Group Newsgroups: comp.lang.ada Date: 1997-06-20T00:00:00+00:00 List-Id: I am trying to create a program with Ada and Assembly components on a Pentium Linux (2.0.30) system with GNAT 3.09. I have achieved successful linking, but the program segfaults at the point where the Ada program calls the assembly language routine. I've had previous experience with assembly only under DOS on a '286; Linux on a 32-bit processor is quite a different environment. I am using pragma Import with the C calling convention. For now, the assembly routine (declared as a procedure) just does a 'ret'. I compile first the Ada file to an object file using "gnatmake .o", then I run the assembly file through gcc, then run "gnatbind -x" on the .ali file, and finally run gnatlink on the .ali file plus the assembly object file. Since I am winging this mini-project (the only documentation I found was in the RM), I'd rather see snippets of working code than have others attempt to correct my error-filled trials. One last note ... I made one or two simple programs using just assembly (they simply do some register addition and exit, *without* segfaulting, heh), but I cannot debug them (and check what they're actually doing) under gdb 4.16 with GNAT extensions -- gdb reports "no debugging symbols found" and "can't find a default source file". Yes, I used the -g flag during compilation and linkage. I'd really appreciate any pointers, hints, tips, or techniques. TIA -Albert