1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML LANG="ja">
3
4<HEAD>
5    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
6    <META http-equiv="Content-Style-Type" content="text/css">
7
8    <TITLE>Build System Development Guide (for DLLs)</TITLE>
9
10    <STYLE>
11        h1.left
12        {
13            color: #46f;
14            font-size: 120%;
15        }
16        ul.left, ul.left ul
17        {
18            margin: 0;
19            padding: 0;
20        }
21        ul.left
22        {
23            font-size: 0.8em;
24        }
25        ul.left li
26        {
27            margin: 0;
28            padding: 0;
29            margin-left: 1em;
30            line-height: 1.5em;
31        }
32        ul.left li a
33        {
34            margin: 0;
35            padding: 0;
36        }
37
38        H1
39        {
40            font-weight         : bold;
41            font-size           : 250%;
42            text-align          : left;
43            color               : #46f;
44            margin-bottom       : 0px;
45        }
46
47        H2
48        {
49            font-weight         : normal;
50            font-size           : 180%;
51            margin              : 24pt 0pt 6pt 0pt;
52            border-bottom-style : solid;
53            border-bottom-width : 1px;
54        }
55
56        H3
57        {
58            font-weight         : bold;
59            font-size           : 120%;
60            border-bottom-style : solid;
61            border-bottom-width : 1px;
62            width: 75%;
63            margin              : 18pt 0pt 6pt 30pt;
64        }
65
66        H4
67        {
68            font-weight         : bold;
69            font-size           : 100%;
70            margin              : 12pt 0pt 6pt 30pt;
71        }
72
73        H5
74        {
75            font-weight         : bold;
76            margin              : 12pt 0pt 6pt 30pt;
77        }
78
79        H6
80        {
81            font-weight         : bold;
82            margin              : 12pt 0pt 6pt 30pt;
83        }
84
85        DIV.date
86        {
87            text-align          : right;
88            color               : #46f;
89            margin-bottom       : 30pt;
90            line-height         : 150%;
91        }
92
93        P
94        {
95            margin              : 0pt 0pt 12pt 30pt;
96            line-height         : 150%;
97        }
98
99        OL,UL,DL
100        {
101            margin              : 6pt 0pt 6pt 50pt;
102        }
103        OL OL, UL UL
104        {
105            margin-left: 3em;
106        }
107
108        DT
109        {
110            font-family         : "Courier New", monospace;
111            margin-top : 0.3em;
112            margin-bottom : 0.3em;
113        }
114        DD
115        {
116            margin-top : 0.3em;
117            margin-bottom : 0.6em;
118        }
119
120        PRE
121        {
122            font-family         : "Courier New", monospace;
123            font-weight         : normal;
124
125            margin              : 0pt 0pt 20pt 50pt;
126            padding             : 2pt 8pt 2pt 8pt;
127            background-color    : #eee;
128
129            border-style        : solid;
130            border-width        : 1px;
131        }
132        em
133        {
134            font-style: normal;
135            color: red;
136        }
137        TABLE
138        {
139            margin-left         : 40pt;
140            margin-bottom       : 20pt;
141            border-color        : #aaa;
142            border-width        : 1pt;
143            border-style        : solid;
144        }
145        TD
146        {
147            font-style          : normal;
148            padding             : 2pt 4pt 2pt 4pt;
149
150            border-color        : #aaa;
151            border-width        : 1pt;
152            border-style        : solid;
153        }
154        div.footer
155        {
156            border-color: black;
157            padding-top: 0.5em;
158            border-top-style    : solid;
159            border-top-width    : 1px;
160            width:              100%;
161            margin-top: 2em;;
162        }
163        div.footer span
164        {
165            color               : #46f;
166            float: right;
167        }
168        table
169        {
170            border-collapse:    collapse;
171        }
172        table td
173        {
174        }
175        table th
176        {
177        }
178        ul
179        {
180            margin-top: 1em;
181            margin-bottom: 1em;
182        }
183        DL.history
184        {
185            margin: 1em;
186        }
187        DL.history DT
188        {
189            font-family         : sans-serif;
190            font-weight         : bold;
191            font-size           : 0.8em;
192            margin              : 0px;
193        }
194        DL.history DD
195        {
196            font-size           : 0.9em;
197            margin              : 0px 0px 4px 0px;
198        }
199    </STYLE>
200    <SCRIPT type="text/javascript">
201    <!--
202        function DeleteRule(index)
203        {
204            var ss = document.styleSheets.item(0);
205
206            if( ss.removeRule )
207            {
208                ss.removeRule(index);
209            }
210            else
211            {
212                ss.deleteRule(index);
213            }
214        }
215        function OnClickAnchor(e, anchor)
216        {
217            window.parent.frames[1].location.hash = anchor;
218
219            if( e.preventDefault )
220            {
221                e.preventDefault();
222            }
223            else
224            {
225                e.returnValue = false;
226            }
227        }
228        function TravLeft(obj)
229        {
230            var ary = new Array();
231            var index = 0;
232
233            for( var i = 0; i < obj.childNodes.length; ++i )
234            {
235                var c = obj.childNodes.item(i);
236
237                if( c.nodeType == 1 )
238                {
239                    if( c.tagName == "H2" || c.tagName == "H3" )
240                    {
241                        var a = c.childNodes.item(0);
242                        var text  = "";
243
244                        var anchor = "name-" + index;
245                        index++;
246
247                        if( a && a.tagName == "A" )
248                        {
249                            text  = a.innerHTML;
250                        }
251                        else
252                        {
253                            text  = c.innerHTML;
254                        }
255
256                        ary.push([c.tagName.substr(1,1), "<a target=\"right\" href=\"?right#" + anchor + "\" onclick=\"OnClickAnchor(event, '" + anchor + "')\">" + text + "</a>"]);
257                    }
258                    else
259                    {
260                        ary = ary.concat(TravLeft(c));
261                    }
262                }
263            }
264
265            return ary;
266        }
267        function TravRight(obj)
268        {
269            var index = 0;
270
271            for( var i = 0; i < obj.childNodes.length; ++i )
272            {
273                var c = obj.childNodes.item(i);
274
275                if( c.nodeType == 1 )
276                {
277                    if( c.tagName == "H2" || c.tagName == "H3" )
278                    {
279                        var anchor = "name-" + index;
280                        index++;
281
282                        c.innerHTML = "<a name=\"" + anchor + "\">" + c.innerHTML + "</a>"
283                    }
284                    else
285                    {
286                        TravRight(c);
287                    }
288                }
289            }
290        }
291        function OnLoad_Left()
292        {
293            var test = TravLeft(document.body);
294            var test2 = "";
295            var level = 2;
296
297            test2 += "<h1 class='left'>" + document.title + "</h1>";
298            test2 += "<ul class='left'>";
299            for( var i in test )
300            {
301                while( test[i][0] > level )
302                {
303                    level++;
304                    test2 += "<ul>";
305                }
306                while( test[i][0] < level )
307                {
308                    level--;
309                    test2 += "</ul>";
310                }
311
312                test2 += "<li>" + test[i][1];
313            }
314            test2 += "</ul>";
315
316            document.body.innerHTML = test2;
317            DeleteRule(0);
318        }
319        function OnLoad_Right()
320        {
321            TravRight(document.body);
322        }
323        function OnLoad_Frame()
324        {
325            var myname = location.pathname.substr(location.pathname.lastIndexOf("/") + 1);
326
327            var f = document.createElement("frameset");
328            var l = document.createElement("frame");
329            var r = document.createElement("frame");
330
331            f.appendChild(l);
332            f.appendChild(r);
333            f.cols = "250,*";
334
335            l.src  = myname + "?left"  + location.hash;
336            r.src  = myname + "?right" + location.hash;
337            l.name = "Left";
338            r.name = "Right";
339
340            var h = document.documentElement;
341            var b = h.getElementsByTagName("body").item(0);
342
343            h.replaceChild(f, b);
344        }
345
346
347        if( ! window.opera )
348        {
349            var search = location.search;
350
351            if( search == "?left" )
352            {
353                window.onload = OnLoad_Left;
354            }
355            else if( search == "" )
356            {
357                window.onload = OnLoad_Frame;
358            }
359            else if( search == "?right" )
360            {
361                window.onload = OnLoad_Right;
362            }
363
364            if( search != "?right" )
365            {
366                var ss = document.styleSheets.item(0);
367
368                if( ss.addRule )
369                {
370                    ss.addRule("body", "display: none", 0);
371                }
372                else
373                {
374                    ss.insertRule("body {display: none}", 0);
375                }
376            }
377        }
378    //-->
379    </SCRIPT>
380</HEAD>
381
382<BODY>
383
384
385
386
387
388<H1>Build System Development Guide (for DLLs)</H1>
389<DIV class="date">(2012.06.22)</DIV>
390
391
392
393
394
395<H2>Introduction</H2>
396
397<H3>About This Document</H3>
398<P>
399    This document explains how to create a build system that replaces the one provided in the SDK. It provides information necessary for building CRO files and for the CTR applications that use them.
400</P>
401<ul>
402    <li>CRO build sequence
403    <li>Sequence for building applications that use CRO files
404    <li>Procedures for creating each file
405</ul>
406
407<P>
408    This document provides the minimum information necessary to create a build system equivalent to the one provided in the SDK. <br>For more information about creating a more flexible and sophisticated build system, see <a href="BuildSystemDevelopmentGuideForDllAdvanced.html" target="_parent">Build System Development Guide (for High-Level DLLs)</a>.
409</P>
410<P>
411    See <a href="BuildSystemManualForDll.html" target="_parent">CTR-SDK Build System Manual (for DLLs)</a> for information about the structure and usage of the build system provided by the SDK.
412</P>
413<P>
414    This document assumes basic knowledge of CTR-SDK terminology. See <a href="../Glossary/Glossary.html">CTR-SDK Terminology</a> for a glossary of basic CTR-SDK terms.
415</P>
416
417<H3>Notation Used in This Document</H3>
418<P>
419    This document sometimes puts content in colored boxes like the one below to indicate that it is a command sequence to be entered on the command line.
420</P>
421<pre>
422command option1 option2
423</pre>
424
425<P>
426    With respect to command syntax, do not enter text enclosed in angle brackets (&quot;&lt;&quot; and &quot;&gt;&quot;) verbatim. Instead, substitute an appropriate entry for the placeholder description. For example, the string <code>&lt;CTRSDK_ROOT&gt;</code> indicates that you must enter the CTR-SDK installation path.
427</P>
428<P>
429    Text in the command sequence enclosed by square brackets (&quot;[&quot; and &quot;]&quot;) is optional. In the example below, the <SPAN class="argument">-a</SPAN> parameter is optional and can be omitted.
430</P>
431<pre>
432command [-a]
433</pre>
434<P>
435    Elements in the command sequence joined by the pipe symbol (&quot;|&quot;) indicate available choices for a given parameter. In the example below, you can choose either the <CODE>-a</CODE> or <CODE>-b</CODE> option.
436</P>
437<pre>
438command -a|-b
439</pre>
440<P>
441    Strings in the command sequence surrounded by parentheses () and followed by ellipses (...) indicate elements that can be repeated an arbitrary number of times. In the example below, the sequence of <CODE>-a</CODE> followed by a path can be repeated.
442</P>
443<pre>
444command (-a &lt;PATH&gt;)...
445</pre>
446<P>
447    In this document, the names of Windows tools contained in the <CODE>tools/CommandLineTools</CODE> directory are abbreviated by omitting the leading <CODE>ctr_</CODE> and the ending file extension. For example, the abbreviation for <CODE>ctr_makerom32.exe</CODE> is <CODE>makerom</CODE>.
448</P>
449
450
451<H2>Build Sequence</H2>
452
453<H3>Overall Sequence</H3>
454<p>
455    The figure below shows the build sequence when you do not use CRO; for example, if you were to create your application's AXF file from four source files and one static library. <br> <br> <a href="img/dll_flow_normal.png"><img src="img/dll_flow_normal.png" width="277" height="148"></a> <br> The figure below shows the changes when <CODE>module1.c</CODE> and <CODE>module2.cpp</CODE> are used to make CRO files. <br> <br> <a href="img/dll_flow_use_cro.png"><img src="img/dll_flow_use_cro.png" width="469" height="829"></a> <br> <br> Thus, 14 additional build steps are necessary in order to make an existing build system compatible with CRO.
456</p>
457<p>
458    The commands to execute at each of these build steps are described below.
459</p>
460
461
462
463<H3>Partial Linking</H3>
464<p>
465    The build system uses <CODE>armlink</CODE> to partially link the project and get the symbols that the various modules reference and export. <br> <br> <img src="img/dll_flow_partial.png"> <br> <br>Although you essentially use the same command as when creating an application AXF without using CRO, you must add the following options.
466</p>
467<pre>
468--no_scanlib
469--partial
470--vfemode=off
471</pre>
472<p>
473    If you are targeting a static module, do not designate static libraries as input files.
474</p>
475
476
477
478<H3>Create List of Symbols</H3>
479<p>
480    Create a list of symbols from the PLF files, and create the first XRL file. Use <CODE>makecro</CODE> to create the list of symbols. <br> <br> <img src="img/dll_flow_listup.png"> <br> <br> Use <CODE>makecro</CODE> to create a list of symbols as follows:
481</p>
482<pre>
483makecro -l [-a] [-i|-e] -o &lt;INPUT_FILE&gt; &lt;PLF_FILE&gt;
484</pre>
485<p>
486    <CODE>OUTPUT_FILE</CODE> is an XRL file containing a list of the symbols referenced or defined by <CODE>PLF_FILE</CODE>. Specify the <CODE>-a</CODE> option if you are targeting a static module. Specify <CODE>-i</CODE> for a symbol export type of <CODE>index</CODE>, and specify <CODE>-e</CODE> for a symbol export type of <CODE>offset</CODE>. If you do not specify anything, the symbol export type is <CODE>name</CODE>.
487</p>
488
489
490
491<H3>Merge Undefined Symbols</H3>
492<p>
493    This updates the XRL file for the static module and specifies that symbols not defined in any module are defined in the static module. This links standard C functions and SDK functions required by the dynamic modules into the static module. Use <CODE>makecro</CODE> to merge undefined symbols. <br> <br> <img src="img/dll_flow_merge.png"> <br> <br>Use <CODE>makecro</CODE> to resolve symbol references as follows: (Although the command below is separated into multiple lines for ease of viewing, an actual command cannot contain newline characters.)
494</p>
495<pre>
496makecro
497    -c
498    [-i|-e]
499    -o &lt;OUTPUT_FILE&gt;
500    &lt;STATIC_MODULE_XRL_FILE&gt;
501    (-r &lt;DYNAMIC_MODULE_XRL_FILE&gt;)...
502</pre>
503<p>
504    <CODE>OUTPUT_FILE</CODE> is an XRL file created by adding the symbols referenced by <CODE>DYNAMIC_MODULE_XRL_FILE</CODE> but not defined by any module to <CODE>STATIC_MODULE_XRL_FILE</CODE>. Specify <CODE>-i</CODE> for an export type of <CODE>index</CODE> for the added symbols and specify <CODE>-e</CODE> for an export type of <CODE>offset</CODE>. If you do not specify anything, the export type of the added symbols is <CODE>name</CODE>.
505</p>
506
507
508
509<H3>Resolve Symbol References</H3>
510<p>
511    For each symbol referenced by a module, find the module that defines it, and add this information to the XRL file. Use <CODE>makecro</CODE> to resolve the symbol references. <br> <br> <img src="img/dll_flow_resolve.png"> <br> <br>Use <CODE>makecro</CODE> to resolve symbol references as follows:
512</p>
513<pre>
514makecro -f -o &lt;OUTPUT_FILE&gt; &lt;XRL_FILE&gt; (-r &lt;REFERENCE_XRL_FILE&gt;)...
515</pre>
516<p>
517    <CODE>OUTPUT_FILE</CODE> is the original XRL file (<CODE>XRL_FILE</CODE>) updated with the contents of <CODE>REFERENCE_XRL_FILE</CODE>.
518</p>
519<p>
520    You must execute this command on the XRL files for each module, using that module's file as <CODE>XRL_FILE</CODE> and those of the other modules as <CODE>REFERENCE_XRL_FILE</CODE>. Assuming that your project comprises static module <CODE>App</CODE> and dynamic modules <CODE>Module1</CODE> and <CODE>Module2</CODE>, you would need to execute the following equivalent command on all three modules:
521</p>
522<pre>
523makecro -f -o App.f.xrl     App.xrl     -r Module1.xrl -r Module2.xrl
524makecro -f -o Module1.f.xrl Module1.xrl -r App.xrl     -r Module2.xrl
525makecro -f -o Module2.f.xrl Module2.xrl -r App.xrl     -r Module1.xrl
526</pre>
527
528
529
530<H3>Create Command File</H3>
531<p>
532    In the &quot;Merge Undefined Symbols&quot; step, you merged undefined symbols into the XRL file of the static module. Now, create a command-line options file to load these undefined symbols from the static library and export them. Use <CODE>makecro</CODE> to create the command file. <br> <br> <img src="img/dll_flow_uae.png"> <br> Use <CODE>makecro</CODE> as follows to create the command file:
533</p>
534<pre>
535makecro -x -o &lt;OUTPUT_FILE&gt; &lt;XRL_FILE&gt;
536</pre>
537<p>
538    <CODE>OUTPUT_FILE</CODE> is a command file generated based on <CODE>XRL_FILE</CODE>.
539</p>
540
541
542
543<H3>Create Steering Files</H3>
544<p>
545    Create a steering file to give the linker import and export instructions. Use <CODE>makecro</CODE> to create the steering file. <br> <br> <img src="img/dll_flow_edit.png"> <br> Use <CODE>makecro</CODE> as follows to create the steering file:
546</p>
547<pre>
548makecro -s -o &lt;OUTPUT_FILE&gt; &lt;XRL_FILE&gt;
549</pre>
550<p>
551    <CODE>OUTPUT_FILE</CODE> is a steering file generated based on <CODE>XRL_FILE</CODE>.
552</p>
553
554
555
556<H3>Link Static Module</H3>
557<p>
558    Use <CODE>armlink</CODE> to link the static module, adding the specifications of the command file and steering file to the command-line options. <br> <br> <img src="img/dll_flow_link_static.png"> <br> <br>Although you essentially use the same command as when creating an application AXF without using CRO, you must add the following options.
559</p>
560<pre>
561--base_platform
562--edit=&lt;STEERING_FILE&gt;
563--override_visi.
564--pltgot=direct
565--undefined_and_export=nnroAeabiAtexit_
566--vfemode=off
567--via &lt;COMMAND_FILE&gt;
568</pre>
569<p>
570    <CODE>STEERING_FILE</CODE> is the steering file you created in the &quot;Create Steering File&quot; step, and <CODE>COMMAND_FILE</CODE> is the <CODE>use</CODE> file that you created in the &quot;Create Command File&quot; step.
571</p>
572
573
574
575<H3>Link Dynamic Modules</H3>
576<p>
577    Use <CODE>armlink</CODE> to link the dynamic modules, adding the specifications of the steering file to the command-line options. <br> <br> <img src="img/dll_flow_link_dynamic.png"> <br> <br>Although you essentially use the same command as when creating an application AXF without using CRO, you must add the following options.
578</p>
579<pre>
580--base_platform
581--dll
582--edit=&lt;STEERING_FILE&gt;
583--no_cppinit
584--no_scanlib
585--override_visi.
586--pltgot=direct
587--scatter=&lt;CTRSDK_ROOT&gt;/resources/specfiles/linker/CTR.Ro.MPCore.ldscript
588--undefined_and_export=nnroControlObject_
589--emit_non_debug_relocs
590</pre>
591<p>
592    Set <CODE>STEERING_FILE</CODE> to the steering file you created in the &quot;Create Steering File&quot; step. Set the <CODE>--scatter</CODE> option to <CODE>CTR.Ro.MPCore.ldscript</CODE> rather than <CODE>CTR.Process.MPCore.ldscript</CODE>.
593</p>
594<p>
595    Do not specify the following option:
596</p>
597<pre>
598--keep=nnMain
599</pre>
600<p>
601    You also do not need to specify <CODE>crt0.o</CODE> as an input file.
602</p>
603<p>
604    You must also specify the following option if you use C++ exceptions:
605</p>
606<pre>
607--undefined=nnroEitNode_
608</pre>
609
610
611
612<H3>Create Command File 2</H3>
613<p>
614Create a command-line option file to implement the changes for symbols for which there were changes to the references in the &quot;Resolve Symbol References&quot; step.<br> Use <CODE>makecro</CODE> to create command file 2. <br> <br> <img src="img/dll_flow_fil.png"> <br> Use <CODE>makecro</CODE> as follows to create command file 2.
615</p>
616<pre>
617makecro -w -o &lt;OUTPUT_FILE&gt; &lt;XRL_FILE&gt;
618</pre>
619<p>
620    The command file 2 is created based on <CODE>XRL_FILE</CODE> and generated as <CODE>OUTPUT_FILE</CODE>.
621</p>
622
623
624
625<H3>Forced References</H3>
626<p>
627Implement changes to references for symbols for which there were changes to the references in &quot;Resolve Symbol References.&quot;<br> Use <CODE>fromelf</CODE>, which is included in ARMCC, to force the references.  <br> <br> <img src="img/dll_flow_import.png"> <br> <br>This is how to use <CODE>fromelf</CODE> to force the references:
628</p>
629<pre>
630fromelf &lt;axf file&gt; --elf -o &lt;output file&gt; --via &lt;command file 2&gt;
631</pre>
632<p>
633    An AXF file for which the changes to the references in &quot;axf file&quot;  were applied based on the specifications in &quot;command file 2&quot; will be output as &quot;output file.&quot;
634</p>
635
636
637
638<H3>Resolve Offsets</H3>
639<p>
640    Get symbol-offset information from the AXF file that the linker created, and update the XRL file. Use <CODE>makecro</CODE> to resolve offsets. <br> <br> <img src="img/dll_flow_offset.png"> <br> <br> Use <CODE>makecro</CODE> to resolve XRL offsets as follows:
641</p>
642<pre>
643makecro &lt;AXF_FILE&gt; -p -o &lt;OUTPUT_FILE&gt; -d &lt;XRL_FILE&gt;
644</pre>
645<p>
646    <CODE>OUTPUT_FILE</CODE> is the original XRL file (<CODE>XRL_FILE</CODE>) updated with offset information based on <CODE>AXF_FILE</CODE>.
647</p>
648
649
650
651<H3>Create CRS File</H3>
652<p>
653    Create the CRS file from the static-module AXF file and XRL file. <br>Use <CODE>makecro</CODE> to create the <CODE>.crs</CODE> file. <br> <br> <img src="img/dll_flow_crs.png"> <br> Use <CODE>makecro</CODE> as follows to create the CRS file: (Although the command below is separated into multiple lines for ease of viewing, an actual command cannot contain newline characters.)
654</p>
655<pre>
656makecro
657    &lt;AXF_FILE&gt;
658    -o &lt;OUTPUT_FILE&gt;
659    -d &lt;XRL_FILE&gt;
660    (-r &lt;REFERENCE_XRL_FILE&gt;)...
661</pre>
662<p>
663    This creates <CODE>OUTPUT_FILE</CODE> as a CRS file from <CODE>AXF_FILE</CODE>, in accordance with the specifications of <CODE>XRL_FILE</CODE>. Use <CODE>REFERENCE_XRL_FILE</CODE> to resolve the offsets of other modules.
664</p>
665<p>
666    You must execute the command using <CODE>XRL_FILE</CODE> to designate the XRL file corresponding to the static module, and <CODE>REFERENCE_XRL_FILE</CODE> to designate the other XRL files. Assuming that your project comprises static module <CODE>App</CODE> and dynamic modules <CODE>Module1</CODE> and <CODE>Module2</CODE>, use the following command to create the CRS file.
667</p>
668<pre>
669makecro App.axf -o App.crs -d App.xrl -r Module1.xrl -r Module2.xrl
670</pre>
671
672
673
674<H3>Create CRO Files</H3>
675<p>
676    Create the CRO files from the dynamic-module AXF files and XRL files. Use <CODE>makecro</CODE> to create the CRO file. <br> <br> <img src="img/dll_flow_cro.png"> <br> Use <CODE>makecro</CODE> as follows to create the CRO file: (Although the command below is separated into multiple lines for ease of viewing, an actual command cannot contain newline characters.)
677</p>
678<pre>
679makecro
680    &lt;AXF_FILE&gt;
681    -o &lt;OUTPUT_FILE_1&gt;
682    -t &lt;OUTPUT_FILE_2&gt;
683    -d &lt;XRL_FILE&gt;
684    (-r &lt;REFERENCE_XRL_FILE&gt;)...
685</pre>
686<p>
687    This creates <CODE>OUTPUT_FILE_1</CODE> as the CRO file from <CODE>AXF_FILE</CODE>, in accordance with the specifications of <CODE>XRL_FILE</CODE>. At the same time, it creates <CODE>OUTPUT_FILE_2</CODE> as the <CODE>cro.rlt</CODE> file. Use <CODE>REFERENCE_XRL_FILE</CODE> to resolve the offsets of other modules.
688</p>
689<p>
690    You must execute the command using <CODE>XRL_FILE</CODE> to designate the XRL file corresponding to the target dynamic module, and <CODE>REFERENCE_XRL_FILE</CODE> to designate the other XRL files. Assuming that your project comprises static module <CODE>App</CODE> and dynamic modules <CODE>Module1</CODE> and <CODE>Module2</CODE>, use the following command to create the CRO files.
691</p>
692<pre>
693makecro Module1.axf -o Module1.cro -t Module1.cro.rlt -d Module1.xrl -r App.xrl -r Module2.xrl
694</pre>
695
696
697
698<H3>Create CRR File</H3>
699<p>
700    This creates the CRR file by merging the <CODE>.cro.rlt</CODE> files. Use <CODE>makecrr</CODE> to create the CRR file. <br> <br> <img src="img/dll_flow_crr.png"> <br> Use <CODE>makecrr</CODE> as follows:
701</p>
702<pre>
703makecrr [-d] -o &lt;output file&gt; (-r &lt;.cro.rlt file&gt;)...
704</pre>
705<p>
706    <CODE>OUTPUT_FILE</CODE> is a CRR file merging the <CODE>.cro.rlt</CODE> files (<CODE>CRO_RLT_FILE</CODE>). Specify the <CODE>-d</CODE> option to store information necessary for debugging the <CODE>CRO</CODE> object in the CRR file.
707</p>
708
709
710
711<H2>nnroUnresolved</H2>
712<p>
713Using the <CODE>nnroUnresolved</CODE> function with the static module requires additional build steps. <br/> These steps are the additional build steps that are required to use the <CODE>nnroUnresolved</CODE> function with the static module.
714</p>
715<p>
716    A detailed explanation of the  <CODE>nnroUnresolved</CODE> function is contained in the <a href="DllManual.html#nnroUnresolved" target="_parent"><CODE>DLL Manual</CODE></a>.
717</p>
718
719<H3>Build Sequence</H3>
720<p>
721    Below is the build sequence surrounding the creation of a CCI file or a CXI file from the AFX file of the application, when DLLs are used: <br> <br> <img src="img/dll_flow_unr_old.png"> <br> <br> That gets changed as shown below:<br> <br> <br> <img src="img/dll_flow_unr_new.png"> <br> <br>In addition, you need to specify an additional command line option when creating the command file.
722</p>
723<p>
724    The commands to execute at each of these build steps are described below.
725</p>
726
727
728<H3>Create Command File</H3>
729<p>
730If the <CODE>nnroUnresolved</CODE> function is used with the static module, you must specify an additional command-line option in the &quot;Create Command File&quot; step. The additional option is <code>-y nnroUnresolved</code>. This is how you would use <CODE>makecro</CODE>:
731</p>
732<pre>
733makecro -x -y nnroUnresolved -o &lt;<I>output file</I>&gt; &lt;<I>XRL file</I>&gt;
734</pre>
735
736<H3>Replace the Reference</H3>
737<p>
738In the <CODE>.axf</CODE> file, the place where the DLL symbol is referenced should be overwritten to reference <CODE>nnroUnresolved</CODE>. <br> Use <CODE>makecro</CODE> to replace the reference.  <br> <br> <img src="img/dll_flow_replace.png"> <br> <br>This is how to use <CODE>makecro</CODE> to replace the reference:
739</p>
740<pre>
741makecro -u nnroUnresolved -o &lt;<I>output file</I>&gt; &lt;<I>input file</I>&gt;
742</pre>
743<p>
744    An AXF file based on the <I>input file</I>, but with the reference replaced, is created as the <I>output file</I>.
745</p>
746
747
748
749<H2>Revision History</H2>
750<dl class="history">
751    <dt>2012/07/10</dt>
752    <dd>
753Added <CODE>--emit_non_debug_relocs</CODE> as a necessary option in the &quot;Link Dynamic Modules&quot; step.
754    </dd>
755
756    <dt>2012/06/22</dt>
757    <dd>
758Added a link to <I>Guide to Developing a Build System (for High-Level DLLs)</I>.<br/>
759    </dd>
760
761    <dt>2012/04/23</dt>
762    <dd>
763        Updated &quot;Overall Sequence.&quot; Added &quot;Command File 2&quot; and &quot;Forced References.&quot;
764    </dd>
765
766    <dt>2012/02/27</dt>
767    <dd>
768        Corrected the command to create a CRS file in the &quot;Create CRS File&quot; section.<br> Corrected a typo.
769    </dd>
770
771    <dt>2012/02/20</dt>
772    <dd>
773        Corrected the command to create <CODE>app.crs</CODE> in the overall sequence chart.
774    </dd>
775
776    <dt>2011/12/12</dt>
777    <dd>
778        Added the section <B>nnroUnresolved</B>.
779    </dd>
780
781    <dt>2011/09/26</dt>
782    <dd>
783        Added description of the <CODE>-d</CODE> option to <B>Create CRR File</B>. Added the Revision History section.
784    </dd>
785
786    <dt>2011/08/03</dt>
787    <dd>
788        Initial version.
789    </dd>
790</dl>
791
792
793<div class="footer"><span>Guide to Developing a Build System (for DLLs)</span></div>
794
795  <hr><p>CTR-06-0203-002-G<br>CONFIDENTIAL</p></body>
796</HTML>