[Info-vax] VMS internals design, was: Re: BASIC and AST routines
hb
end.of at inter.net
Wed Dec 1 16:23:41 EST 2021
On 12/1/21 8:50 PM, Stephen Hoffman wrote:
> The Linker isn't particularly sensitive to API declarations, and will
> probably not notice any API differences. API contract "enforcement" here
> is usually by app failure.
>
> Otherwise—if BASIC won't play nice with a one-argument AST
> declaration—specify the context pointer and whatever other four values
> will be tolerated by BASIC and the Linker.
The linker matches symbols, which represent references and definitions.
It complains if it can't find a matching definition for a reference. The
symbol name and the symbol type must match. That is the linker knows
about data and routines. It will not let you define an object for a
routine reference. That's more or less all the linker does, here.
With C++ you get the API encoded in the symbol name, also known as
"decorated" or "mangled" name. With matching such symbols the linker
implicitly checks the API and does notice a difference, that is, it will
print an unresolved reference warning. For example, if you call (or take
the address of) "foo(int,int)" but only define a "foo(int)" you will see
%ILINK-I-UDFSYM, CX3$_Z3FOOII2INROLH
%ILINK-W-USEUNDEF, undefined symbol CX3$_Z3FOOII2INROLH referenced
source code name: "foo(int, int)"
More information about the Info-vax
mailing list