[Vm-dev] #pragma export on/off

John M McIntosh johnmci at smalltalkconsulting.com
Fri Feb 20 03:57:44 UTC 2009


Well the pattern used  is like so where we ask the operating system to  
find the entry point secCanRenameImage in the SecurityPlugin
which relies on the plugin either being external, or internal, and if  
the plugin actually has the secCanRenameImage.
This code enables weak linking....

		sCRIfn = ioLoadFunctionFrom("secCanRenameImage", "SecurityPlugin");
		if (sCRIfn != 0) {
			okToRename =  ((sqInt (*)(void))sCRIfn)();
			if (!(okToRename)) {
				/* begin primitiveFail */
				foo->successFlag = 0;
				return null;
			}
		}



On 19-Feb-09, at 7:52 PM, Igor Stasenko wrote:

>
> 2009/2/20 Eliot Miranda <eliot.miranda at gmail.com>:
>>
>> Hi All,
>>    anyone know what platform this pragma is aimed at, and whether  
>> we still really, really need it?  It is the source of the bulk of  
>> my warnings in the cog interpreter and I'd love to nuke it.
>> E.
>>
> +1 for nuking it :)
> As i understand this pragma ensuring that given symbol will appear in
> module exports table, so other modules could lookup this symbol and
> call these functions directly.
> I fail see how such functions could be called directly bypassing rules
> which ensuring a level of safety for VM - like InterpreterProxy.
>
>
>
> -- 
> Best regards,
> Igor Stasenko AKA sig.

--
= 
= 
= 
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================





More information about the Vm-dev mailing list