ld: MRI
1
1 Appendix A MRI Compatible Script Files
1 **************************************
1
1 To aid users making the transition to GNU 'ld' from the MRI linker, 'ld'
1 can use MRI compatible linker scripts as an alternative to the more
1 general-purpose linker scripting language described in ⇒Scripts.
1 MRI compatible linker scripts have a much simpler command set than the
1 scripting language otherwise used with 'ld'. GNU 'ld' supports the most
1 commonly used MRI linker commands; these commands are described here.
1
1 In general, MRI scripts aren't of much use with the 'a.out' object
1 file format, since it only has three sections and MRI scripts lack some
1 features to make use of them.
1
1 You can specify a file containing an MRI-compatible script using the
1 '-c' command-line option.
1
1 Each command in an MRI-compatible script occupies its own line; each
1 command line starts with the keyword that identifies the command (though
1 blank lines are also allowed for punctuation). If a line of an
1 MRI-compatible script begins with an unrecognized keyword, 'ld' issues a
1 warning message, but continues processing the script.
1
1 Lines beginning with '*' are comments.
1
1 You can write these commands using all upper-case letters, or all
1 lower case; for example, 'chip' is the same as 'CHIP'. The following
1 list shows only the upper-case form of each command.
1
1 'ABSOLUTE SECNAME'
1 'ABSOLUTE SECNAME, SECNAME, ... SECNAME'
1 Normally, 'ld' includes in the output file all sections from all
1 the input files. However, in an MRI-compatible script, you can use
1 the 'ABSOLUTE' command to restrict the sections that will be
1 present in your output program. If the 'ABSOLUTE' command is used
1 at all in a script, then only the sections named explicitly in
1 'ABSOLUTE' commands will appear in the linker output. You can
1 still use other input sections (whatever you select on the command
1 line, or using 'LOAD') to resolve addresses in the output file.
1
1 'ALIAS OUT-SECNAME, IN-SECNAME'
1 Use this command to place the data from input section IN-SECNAME in
1 a section called OUT-SECNAME in the linker output file.
1
1 IN-SECNAME may be an integer.
1
1 'ALIGN SECNAME = EXPRESSION'
1 Align the section called SECNAME to EXPRESSION. The EXPRESSION
1 should be a power of two.
1
1 'BASE EXPRESSION'
1 Use the value of EXPRESSION as the lowest address (other than
1 absolute addresses) in the output file.
1
1 'CHIP EXPRESSION'
1 'CHIP EXPRESSION, EXPRESSION'
1 This command does nothing; it is accepted only for compatibility.
1
1 'END'
1 This command does nothing whatever; it's only accepted for
1 compatibility.
1
1 'FORMAT OUTPUT-FORMAT'
1 Similar to the 'OUTPUT_FORMAT' command in the more general linker
1 language, but restricted to one of these output formats:
1
1 1. S-records, if OUTPUT-FORMAT is 'S'
1
1 2. IEEE, if OUTPUT-FORMAT is 'IEEE'
1
1 3. COFF (the 'coff-m68k' variant in BFD), if OUTPUT-FORMAT is
1 'COFF'
1
1 'LIST ANYTHING...'
1 Print (to the standard output file) a link map, as produced by the
1 'ld' command-line option '-M'.
1
1 The keyword 'LIST' may be followed by anything on the same line,
1 with no change in its effect.
1
1 'LOAD FILENAME'
1 'LOAD FILENAME, FILENAME, ... FILENAME'
1 Include one or more object file FILENAME in the link; this has the
1 same effect as specifying FILENAME directly on the 'ld' command
1 line.
1
1 'NAME OUTPUT-NAME'
1 OUTPUT-NAME is the name for the program produced by 'ld'; the
1 MRI-compatible command 'NAME' is equivalent to the command-line
1 option '-o' or the general script language command 'OUTPUT'.
1
1 'ORDER SECNAME, SECNAME, ... SECNAME'
1 'ORDER SECNAME SECNAME SECNAME'
1 Normally, 'ld' orders the sections in its output file in the order
1 in which they first appear in the input files. In an
1 MRI-compatible script, you can override this ordering with the
1 'ORDER' command. The sections you list with 'ORDER' will appear
1 first in your output file, in the order specified.
1
1 'PUBLIC NAME=EXPRESSION'
1 'PUBLIC NAME,EXPRESSION'
1 'PUBLIC NAME EXPRESSION'
1 Supply a value (EXPRESSION) for external symbol NAME used in the
1 linker input files.
1
1 'SECT SECNAME, EXPRESSION'
1 'SECT SECNAME=EXPRESSION'
1 'SECT SECNAME EXPRESSION'
1 You can use any of these three forms of the 'SECT' command to
1 specify the start address (EXPRESSION) for section SECNAME. If you
1 have more than one 'SECT' statement for the same SECNAME, only the
1 _first_ sets the start address.
1