comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com (Ted Dennison)
Subject: Re: VxWorks: Link problem
Date: 1 Feb 2002 08:37:21 -0800
Date: 2002-02-01T16:37:22+00:00	[thread overview]
Message-ID: <4519e058.0202010837.730e7b4f@posting.google.com> (raw)
In-Reply-To: a3dt2s$t7j$1@newstoo.ericsson.se

"Petter Fryklund" <qsbpefr@esavionics.se> wrote in message news:<a3dt2s$t7j$1@newstoo.ericsson.se>...
> I get undefined reference for high123 and low123 when trying to make
> VwWorks_rom including this little neat machine code: (AdaMULTI builds OK!)
> procedure rdtsc (High, Low : out Interfaces.Unsigned_32) is
> 
>    high123 : Interfaces.Unsigned_32;
>    low123  : Interfaces.Unsigned_32;
>    pragma Export (C, High123, "high123");
>    pragma Export (C, Low123, "low123");

Out of curiosity, why are you exporting these? They appear to be
internal variables. I don't see what good it would be for some other
external routine to link to them. Do you actually have another routine
somewhere that tries to link against them?

I'm not sure this is legal in any event, as the variables are declared
local to a procedure, not in a global conext. They get allocated on
the stack when the routine is entered, and removed from the stack when
it exits. Thus there's no static address for external routines to bind
to. If you really want them exported, they should probably be declared
in the outer scope of a package spec or body.

-- 
T.E.D. 
Home     -  mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage -  http://www.telepath.com/dennison/Ted/TED.html



      reply	other threads:[~2002-02-01 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-01 11:35 VxWorks: Link problem Petter Fryklund
2002-02-01 16:37 ` Ted Dennison [this message]
replies disabled

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