Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Configuring the Linking of Object Files and Libraries (Embedded Development Module)

LabVIEW Microprocessor SDK 2.5 Help
August 2007

NI Part Number:
372197A-01

»View Product Info

The target-specific LEP_x _ScriptLinker.vi links all intermediate object files (.o), external libraries, and operating system libraries to generate the application image. LEP_x_ScriptLinker.vi is located in the following directory:

labview\Targets\Embedded\os\os_LEP_TargetPlugin

where os is the target operating system.

You must implement LEP_ x _ScriptLinker.vi if you require behavior that differs from the default implementation.

LEP_ x _Build.vi executes LEP_ x _ScriptLinker.vi only once to produce the final application image. LEP_ x _ScriptLinker.vi must enumerate all intermediate object files, external files, run-time libraries, and operating system libraries.

Some targets use prjObjs.lst to get a list of all modules to avoid long command lines. LEP_ x _Build.vi generates prjObjs.lst and lists all binary modules and libraries.

VxWorks module targets do not link with the operating system libraries because the VxWorks module loader resolves all symbols. The VxWorks and eCos example targets do not have pre-compiled run-time libraries, so LEP_ x _ScriptLinker.vi also must link with the run-time library intermediate files. LEP_ x _Build.vi executes the default implementation of the LEP_ x _ScriptLinker.vi unless you override the default implementation and create a custom LEP_ x _ScriptLinker.vi. You can override the default implementation by wiring a LEP_ x _ScriptLinker.vi VI reference to the Linker Script input of LEP_ x _Build.vi. Your custom implementation of LEP_ x _ScriptLinker.vi must have the same connector pane as the default implementation.

LEP_ x _ScriptLinker.vi can execute the C linker directly by calling the System Exec VI. You also can use a batch file to directly execute the linker. Use a batch file if you need to set linker-specific system variables before the linker can execute. For example, the VxWorks example targets use a batch file because you must set the Tornado system variables before the C compiler executes.

For most targets, the base target provides a complete, tools-aware embedded OS build framework with the default implementation of LEP_ x _ScriptLinker.vi. You can use the base target default implementation of the build framework and LEP_ x _ScriptLinker.vi and override just the necessary features.

The VxWorks CMD565 example target uses a subtarget-specific implementation, which is located in the following file:

labview\Targets\NI\Embedded\vxworks\cmd565\vxworks_cmd565_LEP_TargetPlugin\LEP_vxworks_cmd565_Build.vi

This implementation overrides the default implementation of the LEP_x_ScriptCompiler.vi, LEP_x_ScriptLinker.vi, and LEP_x_Config.vi. Notice the Case structure with target-specific VIs in this custom implementation. The VIs in the Case structure never execute but are always loaded into memory. Because the VIs are loaded into memory, you can use the Open VI Reference function to refer to VIs by name instead of absolute path.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit