Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333932

Summary: Gate_enterModule() can't be used outside a module
Product: [Technology] RTSC Reporter: Dave Russo <d-russo>
Component: RuntimeAssignee: Dave Russo <d-russo>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P3 CC: cring, dfriedland
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Dave Russo CLA 2011-01-10 21:24:51 EST
xdc.runtime.Main is designed to allow any application code to behave as though it were part of the "Main module"; e.g., all uses of Log and Gate should behave as though they came from xdc.runtime.Main.

But if:
    1. application code uses Gate_enterModule(), and
    2. a configuration is created that is partially linked, and
    3. the configuration is whole program optimized

you'll get linker errors complaining that, for example, "xdc_runtime_Main_Module_GateProxy_enter__E is undefined"

This is is a consequence of the fact that the generated big.c does not declare Main's GateProxy functions are being external entry points; during wpo, these functions are removed because the only references to these functions is in code that is not part of the partial link.

If big.c contained the following the problem would be resolved:

#ifdef __ti__
    #pragma FUNC_EXT_CALLED(xdc_runtime_Main_Module_GateProxy_leave__E);
    #pragma FUNC_EXT_CALLED(xdc_runtime_Main_Module_GateProxy_enter__E);
    #pragma FUNC_EXT_CALLED(xdc_runtime_Main_Module_GateProxy_query__E);
#endif