📄 c-loader4.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Object-Module Loader </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="c-loader.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-loader.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-loader3.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-loader5.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="84457">3.4 Using the Target Server Loader</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84458"> </a>Tornado provides access to the loader by several routes: </p></dl><dl class="margin"><ul class="BulletSingle" type="disc"><li><a name="86253"> </a>the Tornado shell</li></ul><ul class="BulletSingle" type="disc"><li><a name="86254"> </a>the WTX Tcl API</li></ul><ul class="BulletSingle" type="disc"><li><a name="86255"> </a>the WTX C API</li></ul><ul class="BulletSingle" type="disc"><li><a name="84462"> </a>the WTX Java API</li></ul></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84463">3.4.1 Loader Usage from the Tornado Shell</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84465"> </a>The Tornado shell provides an interpretive environment that offers easy access to the loader. From the shell, access the loader through the <b class="routine"><i class="routine">ld</i></b><b>( )</b> command:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84467"></b><tt class="output">-></tt><b> ld <i class="textVariable">symbolsVisibility</i>, <i class="textVariable">commonSymbolsPolicy</i>, "<i class="textVariable">objectFile</i>"</a></b></pre></dl><dd><p class="Body"><a name="84468"> </a>The <i class="textVariable">symbolsVisibility</i> argument may be:</p></dl><dl class="margin"><dd><div class="Item"><a name="84469"> </a><b class="command">-1</b> </div><dl class="margin"><dd><div class="Indent"><a name="84471"> </a>Load no symbols to the target server symbol table (mutually exclusive with other options). There is no way to know the contents of the module.<b class="symbol_UC"> </b></div><br></dl><dd><div class="Item"><a name="84472"> </a><b class="command">0</b> </div><dl class="margin"><dd><div class="Indent"><a name="84473"> </a>Load only global symbols to the target server symbol table. This is the default.</div><br></dl><dd><div class="Item"><a name="84474"> </a><b class="command">1</b> </div><dl class="margin"><dd><div class="Indent"><a name="84475"> </a>Load both local and global symbols to the target server symbol table<b class="symbol_UC">.</b></div><br></dl></dl><dl class="margin"><dd><p class="Body"><a name="84476"> </a>The <i class="textVariable">commonSymbolsPolicy</i> argument may be:</p></dl><dl class="margin"><dd><div class="Item"><a name="84477"> </a><b class="command">0</b> </div><dl class="margin"><dd><div class="Indent"><a name="84478"> </a> Keep common symbols isolated, visible from the object module only. This option prevents any matching with already-existing symbols (in other words, the relocations that refer to these symbols are kept local). Common symbols are added to the symbol table unless <b class="symbol_UC">LOAD_NO_SYMBOLS</b> is set. This is the default option with behavior equivalent to <b class="symbol_UC">LOAD_COMMON_MATCH_NONE</b>. (For definitions of these and other options, see <a href="c-loader5.html#84852"><i class="title">3.5.4 Loader Options</i></a>.)</div><br></dl><dd><div class="Item"><a name="84484"> </a><b class="command">1</b> </div><dl class="margin"><dd><div class="Indent"><a name="84485"> </a> Seek a matching symbol in the target server symbol table, considering only symbols in user modules. If no matching symbol exists, the behavior is equivalent to <b class="symbol_UC">LOAD_COMMON_MATCH_NONE</b>.</div><br></dl><dd><div class="Item"><a name="84487"> </a><b class="command">2</b> </div><dl class="margin"><dd><div class="Indent"><a name="84488"> </a> Seek a matching symbol in the target server symbol table, considering all symbols. If no matching symbol exists, the behavior is equivalent to <b class="symbol_UC">LOAD_COMMON_MATCH_NONE</b>.</div><br></dl></dl><dl class="margin"><dd><p class="Body"><a name="84493"> </a>For a complete discussion of loader behavior, see <a href="c-loader5.html#84577"><i class="title">3.5 Loader Architecture</i></a>.</p><dd><p class="Body"><a name="84494"> </a>To call the loader from the shell, enter:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84495"></b><tt class="output">-> </tt><b>ld 0, 0, "/home/users/me/myFile.o"</a></b></pre></dl><dd><p class="Body"><a name="84496"> </a>You can also use input redirection:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84497"></b><tt class="output">-></tt><b> ld </home/users/me/myFile.o</a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84498">3.4.2 Loader Usage From <b class="keyword">wtxtcl</b></a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84500"> </a>Another way to access the loader facilities of the target server is through the WTX Tcl binding to the WTX protocol. This environment offers the scripting advantages of Tcl and the ability to manipulate the WTX protocol directly. From the <b class="command">wtxtcl</b> tool (see <a href="c-wtx4.html#85261"><i class="title">4.4.2 Starting a wtxtcl Session</i></a>), access the loader through the <b class="tclProc">wtxObjModuleLoad</b> routine:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84505"></b><tt class="output">wtxtcl> </tt><b>wtxObjModuleLoad <i class="textVariable">[option]</i> <i class="textVariable">object- file</i></a></b></pre></dl><dd><p class="Body"><a name="84547"> </a>The <i class="textVariable">option</i> argument is an optional parameter from the following list:<p class="table"><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84509"> </a><b class="symbol_UC">LOAD_NO_SYMBOLS </b></p></td><td width="10"> </td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84512"> </a><b class="symbol_UC">LOAD_COMMON_MATCH_NONE </b></p></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84515"> </a><b class="symbol_UC">LOAD_LOCAL_SYMBOLS </b></p></td><td width="10"> </td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84518"> </a><b class="symbol_UC">LOAD_COMMON_MATCH_USER </b></p></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84521"> </a><b class="symbol_UC">LOAD_GLOBAL_SYMBOLS </b></p></td><td width="10"> </td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84524"> </a><b class="symbol_UC">LOAD_COMMON_MATCH_ALL </b></p></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84527"> </a><b class="symbol_UC">LOAD_ALL_SYMBOLS </b></p></td><td width="10"> </td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84530"> </a><b class="symbol_UC">LOAD_HIDDEN_MODULE </b></p></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84533"> </a><b class="symbol_UC">LOAD_FULLY_LINKED </b></p></td><td width="10"> </td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84536"> </a><b class="symbol_UC">LOAD_BAL_OPTIM </b></p></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84538"> </a><b class="symbol_UC">LOAD_NO_DOWNLOAD </b></p></td><td width="10"> </td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84541"> </a><b class="symbol_UC">LOAD_FILE_OUTPUT </b></p></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84544"> </a><b class="symbol_UC">LOAD_CORE_FILE </b></p></td><td width="10"> </td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84546"> </a><b class="symbol_UC"></b></p></td><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><dd><p class="Body"><a name="84548"> </a>You can combine several options by linking them with the "|" character. For a detailed discussion of these parameters, see <a href="c-loader5.html#84852"><i class="title">3.5.4 Loader Options</i></a>.</p><dd><p class="Body"><a name="84552"> </a>Examples:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84553"></b><tt class="output">wtxtcl> </tt><b>wtxObjModuleLoad /home/users/me/myFile.o</b><tt class="output"> wtxtcl></tt><b> wtxObjModuleLoad LOAD_ALL_SYMBOLS /home/users/me/myFile.o</b><tt class="output"> wtxtcl></tt><b> wtxObjModuleLoad LOAD_GLOBAL_SYMBOLS|LOAD_COMMON_MATCH_USER \ /home/users/me/myFile.o</a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84556">3.4.3 Loader Usage From the WTX C API</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84558"> </a>You can also call the loader from C programs on the host, using the WTX C language binding. For details about using <b class="routine"><i class="routine">wtxObjModuleLoad</i></b><b>( )</b>, see the online reference material under <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tornado API Reference>WTX C Library</font></b>. For general information on using C, see <a href="c-wtx5.html#85723"><i class="title">4.5 WTX C API</i></a>. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84565">3.4.4 Asynchronous Load Operation</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84567"> </a>The target-server loader implementation allows you to submit load operations asynchronously. Three APIs provide routines that support the loader: the Tcl, C and Java APIs. Each API provides three routines to handle this feature. The routines are listed below according to the Tcl convention: </p></dl><dl class="margin"><dd><div class="Item"><a name="84569"> </a><b class="tclProc">wtxObjModuleLoadStart</b><b>( )</b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="84570"> </a>Submit a load operation. This routine returns when the file has been written to the target server memory.</div><br></dl></dl><dd><div class="Item"><a name="84573"> </a><b class="tclProc">wtxObjModuleLoadCancel</b><b>( )</b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="84574"> </a>Cancel a submitted load.</div><br></dl></dl><dd><div class="Item"><a name="87674"> </a><b class="tclProc">wtxObjModuleLoadProgressReport</b><b class="routine"><i class="routine"> </i></b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="87675"> </a>Get information about the status of a submitted load. The returned information can be one of the following:</div><br></dl><dl class="margin"><dd><div class="Item3"><a name="87715"> </a><b class="symbol_UC">LOAD_PENDING</b> </div><dl class="margin"><dd><div class="Indent3"><a name="87716"> </a>The load is in queue.</><br></dl><dd><div class="Item3"><a name="87718"> </a><b class="symbol_UC">LOAD_INITIALIZED</b> </div><dl class="margin"><dd><div class="Indent3"><a name="87719"> </a>The being processed.</><br></dl><dd><div class="Item3"><a name="87721"> </a><b class="symbol_UC">LOAD_RELOCATING</b> </div><dl class="margin"><dd><div class="Indent3"><a name="87722"> </a>The loader is relocating symbols.</><br></dl><dd><div class="Item3"><a name="87724"> </a><b class="symbol_UC">LOAD_DOWNLOADING</b></div><dl class="margin"><dd><div class="Indent3"><a name="87725"> </a>The loader is downloading the segments on the target.</><br></dl><dd><div class="Item3"><a name="87727"> </a><b class="symbol_UC">LOAD_COMPLETE</b> </div><dl class="margin"><dd><div class="Indent3"><a name="87734"> </a>The load has been done.</><br></dl><dd><div class="Item3"><a name="87736"> </a><b class="symbol_UC">LOAD_ABORTED</b> </div><dl class="margin"><dd><div class="Indent3"><a name="87737"> </a>The load has been cancelled.</><br></dl></dl></dl></dl></dl><a name="foot"><hr></a><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="c-loader.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-loader.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-loader3.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-loader5.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc. conversion tool: Quadralay WebWorks Publisher 4.0.11 template: CSS Template, Jan 1998 - Jefro --->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -