comp.lang.ada
 help / color / mirror / Atom feed
From: aklee@no_spam.bonsai.net (Albert K. Lee)
Subject: Ada + Assembly ...
Date: 1997/06/20
Date: 1997-06-20T00:00:00+00:00	[thread overview]
Message-ID: <slrn5qka2n.18u.aklee@bonsai.net> (raw)


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
<blah>.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




             reply	other threads:[~1997-06-20  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-20  0:00 Albert K. Lee [this message]
1997-06-23  0:00 ` Ada + Assembly Robert Dewar
replies disabled

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