1<html lang="en"> 2<head> 3<title>MRI - Untitled</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Untitled"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="prev" href="Reporting-Bugs.html#Reporting-Bugs" title="Reporting Bugs"> 9<link rel="next" href="GNU-Free-Documentation-License.html#GNU-Free-Documentation-License" title="GNU Free Documentation License"> 10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 11<!-- 12This file documents the GNU linker LD 13(Sourcery CodeBench Lite 2011.09-69) 14version 2.21.53. 15 16Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 172001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 18 19Permission is granted to copy, distribute and/or modify this document 20under the terms of the GNU Free Documentation License, Version 1.3 21or any later version published by the Free Software Foundation; 22with no Invariant Sections, with no Front-Cover Texts, and with no 23Back-Cover Texts. A copy of the license is included in the 24section entitled ``GNU Free Documentation License''.--> 25<meta http-equiv="Content-Style-Type" content="text/css"> 26<style type="text/css"><!-- 27 pre.display { font-family:inherit } 28 pre.format { font-family:inherit } 29 pre.smalldisplay { font-family:inherit; font-size:smaller } 30 pre.smallformat { font-family:inherit; font-size:smaller } 31 pre.smallexample { font-size:smaller } 32 pre.smalllisp { font-size:smaller } 33 span.sc { font-variant:small-caps } 34 span.roman { font-family:serif; font-weight:normal; } 35 span.sansserif { font-family:sans-serif; font-weight:normal; } 36--></style> 37<link rel="stylesheet" type="text/css" href="../cs.css"> 38</head> 39<body> 40<div class="node"> 41<a name="MRI"></a> 42<p> 43Next: <a rel="next" accesskey="n" href="GNU-Free-Documentation-License.html#GNU-Free-Documentation-License">GNU Free Documentation License</a>, 44Previous: <a rel="previous" accesskey="p" href="Reporting-Bugs.html#Reporting-Bugs">Reporting Bugs</a>, 45Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a> 46<hr> 47</div> 48 49<h2 class="appendix">Appendix A MRI Compatible Script Files</h2> 50 51<p><a name="index-MRI-compatibility-711"></a>To aid users making the transition to <span class="sc">gnu</span> <samp><span class="command">ld</span></samp> from the MRI 52linker, <samp><span class="command">ld</span></samp> can use MRI compatible linker scripts as an 53alternative to the more general-purpose linker scripting language 54described in <a href="Scripts.html#Scripts">Scripts</a>. MRI compatible linker scripts have a much 55simpler command set than the scripting language otherwise used with 56<samp><span class="command">ld</span></samp>. <span class="sc">gnu</span> <samp><span class="command">ld</span></samp> supports the most commonly used MRI 57linker commands; these commands are described here. 58 59 <p>In general, MRI scripts aren't of much use with the <code>a.out</code> object 60file format, since it only has three sections and MRI scripts lack some 61features to make use of them. 62 63 <p>You can specify a file containing an MRI-compatible script using the 64‘<samp><span class="samp">-c</span></samp>’ command-line option. 65 66 <p>Each command in an MRI-compatible script occupies its own line; each 67command line starts with the keyword that identifies the command (though 68blank lines are also allowed for punctuation). If a line of an 69MRI-compatible script begins with an unrecognized keyword, <samp><span class="command">ld</span></samp> 70issues a warning message, but continues processing the script. 71 72 <p>Lines beginning with ‘<samp><span class="samp">*</span></samp>’ are comments. 73 74 <p>You can write these commands using all upper-case letters, or all 75lower case; for example, ‘<samp><span class="samp">chip</span></samp>’ is the same as ‘<samp><span class="samp">CHIP</span></samp>’. 76The following list shows only the upper-case form of each command. 77 78 79<a name="index-g_t_0040code_007bABSOLUTE_007d-_0028MRI_0029-712"></a> 80<dl><dt><code>ABSOLUTE </code><var>secname</var><dt><code>ABSOLUTE </code><var>secname</var><code>, </code><var>secname</var><code>, ... </code><var>secname</var><dd>Normally, <samp><span class="command">ld</span></samp> includes in the output file all sections from all 81the input files. However, in an MRI-compatible script, you can use the 82<code>ABSOLUTE</code> command to restrict the sections that will be present in 83your output program. If the <code>ABSOLUTE</code> command is used at all in a 84script, then only the sections named explicitly in <code>ABSOLUTE</code> 85commands will appear in the linker output. You can still use other 86input sections (whatever you select on the command line, or using 87<code>LOAD</code>) to resolve addresses in the output file. 88 89 <p><a name="index-g_t_0040code_007bALIAS_007d-_0028MRI_0029-713"></a><br><dt><code>ALIAS </code><var>out-secname</var><code>, </code><var>in-secname</var><dd>Use this command to place the data from input section <var>in-secname</var> 90in a section called <var>out-secname</var> in the linker output file. 91 92 <p><var>in-secname</var> may be an integer. 93 94 <p><a name="index-g_t_0040code_007bALIGN_007d-_0028MRI_0029-714"></a><br><dt><code>ALIGN </code><var>secname</var><code> = </code><var>expression</var><dd>Align the section called <var>secname</var> to <var>expression</var>. The 95<var>expression</var> should be a power of two. 96 97 <p><a name="index-g_t_0040code_007bBASE_007d-_0028MRI_0029-715"></a><br><dt><code>BASE </code><var>expression</var><dd>Use the value of <var>expression</var> as the lowest address (other than 98absolute addresses) in the output file. 99 100 <p><a name="index-g_t_0040code_007bCHIP_007d-_0028MRI_0029-716"></a><br><dt><code>CHIP </code><var>expression</var><dt><code>CHIP </code><var>expression</var><code>, </code><var>expression</var><dd>This command does nothing; it is accepted only for compatibility. 101 102 <p><a name="index-g_t_0040code_007bEND_007d-_0028MRI_0029-717"></a><br><dt><code>END</code><dd>This command does nothing whatever; it's only accepted for compatibility. 103 104 <p><a name="index-g_t_0040code_007bFORMAT_007d-_0028MRI_0029-718"></a><br><dt><code>FORMAT </code><var>output-format</var><dd>Similar to the <code>OUTPUT_FORMAT</code> command in the more general linker 105language, but restricted to one of these output formats: 106 107 <ol type=1 start=1> 108<li>S-records, if <var>output-format</var> is ‘<samp><span class="samp">S</span></samp>’ 109 110 <li>IEEE, if <var>output-format</var> is ‘<samp><span class="samp">IEEE</span></samp>’ 111 112 <li>COFF (the ‘<samp><span class="samp">coff-m68k</span></samp>’ variant in BFD), if <var>output-format</var> is 113‘<samp><span class="samp">COFF</span></samp>’ 114 </ol> 115 116 <p><a name="index-g_t_0040code_007bLIST_007d-_0028MRI_0029-719"></a><br><dt><code>LIST </code><var>anything</var><code>...</code><dd>Print (to the standard output file) a link map, as produced by the 117<samp><span class="command">ld</span></samp> command-line option ‘<samp><span class="samp">-M</span></samp>’. 118 119 <p>The keyword <code>LIST</code> may be followed by anything on the 120same line, with no change in its effect. 121 122 <p><a name="index-g_t_0040code_007bLOAD_007d-_0028MRI_0029-720"></a><br><dt><code>LOAD </code><var>filename</var><dt><code>LOAD </code><var>filename</var><code>, </code><var>filename</var><code>, ... </code><var>filename</var><dd>Include one or more object file <var>filename</var> in the link; this has the 123same effect as specifying <var>filename</var> directly on the <samp><span class="command">ld</span></samp> 124command line. 125 126 <p><a name="index-g_t_0040code_007bNAME_007d-_0028MRI_0029-721"></a><br><dt><code>NAME </code><var>output-name</var><dd><var>output-name</var> is the name for the program produced by <samp><span class="command">ld</span></samp>; the 127MRI-compatible command <code>NAME</code> is equivalent to the command-line 128option ‘<samp><span class="samp">-o</span></samp>’ or the general script language command <code>OUTPUT</code>. 129 130 <p><a name="index-g_t_0040code_007bORDER_007d-_0028MRI_0029-722"></a><br><dt><code>ORDER </code><var>secname</var><code>, </code><var>secname</var><code>, ... </code><var>secname</var><dt><code>ORDER </code><var>secname</var> <var>secname</var> <var>secname</var><dd>Normally, <samp><span class="command">ld</span></samp> orders the sections in its output file in the 131order in which they first appear in the input files. In an MRI-compatible 132script, you can override this ordering with the <code>ORDER</code> command. The 133sections you list with <code>ORDER</code> will appear first in your output 134file, in the order specified. 135 136 <p><a name="index-g_t_0040code_007bPUBLIC_007d-_0028MRI_0029-723"></a><br><dt><code>PUBLIC </code><var>name</var><code>=</code><var>expression</var><dt><code>PUBLIC </code><var>name</var><code>,</code><var>expression</var><dt><code>PUBLIC </code><var>name</var> <var>expression</var><dd>Supply a value (<var>expression</var>) for external symbol 137<var>name</var> used in the linker input files. 138 139 <p><a name="index-g_t_0040code_007bSECT_007d-_0028MRI_0029-724"></a><br><dt><code>SECT </code><var>secname</var><code>, </code><var>expression</var><dt><code>SECT </code><var>secname</var><code>=</code><var>expression</var><dt><code>SECT </code><var>secname</var> <var>expression</var><dd>You can use any of these three forms of the <code>SECT</code> command to 140specify the start address (<var>expression</var>) for section <var>secname</var>. 141If you have more than one <code>SECT</code> statement for the same 142<var>secname</var>, only the <em>first</em> sets the start address. 143</dl> 144 145 </body></html> 146 147