Go to the first, previous, next, last section, table of contents.



MRI ȣȯ ½ºÅ©¸³Æ® ÆÄÀÏ

To aid users making the transition to GNU ld from the MRI linker, ld can use MRI compatible linker scripts as an alternative to the more general-purpose linker scripting language described in section Linker Scripts. MRI compatible linker scripts have a much simpler command set than the scripting language otherwise used with ld. GNU ld supports the most commonly used MRI linker commands; these commands are described here.

In general, MRI scripts aren't of much use with the a.out object file format, since it only has three sections and MRI scripts lack some features to make use of them.

MRI ¸µÄ¿¸¦ »ç¿ëÇÏ´Ù°¡ GNU ld·Î º¯°æÇÏ´Â »ç¿ëÀÚ¸¦ À§Çؼ­ ld´Â Linker Scripts¿¡ ¼³¸íµÈ ´õ ¹ü¿ëÀÇ ¸µÄ¿ ½ºÅ©¸³Æ® ¾ð¾î¿¡ ¿Ü¿¡ MRI ȣȯ ¸µÄ¿ ½ºÅ©¸³Æ®µµ »ç¿ëÇÑ´Ù. MRI ȣȯ ¸µÄ¿ ½ºÅ©¸³Æ®´Â ld ½ºÅ©¸³Æ® ¾ð¾î¿¡ ºñÇØ ¸Å¿ì °£´ÜÇÑ ¸í·É¾î¸¦ °¡Áø´Ù. GNU ld´Â ´ëºÎºÐÀÇ MRI ¸µÄ¿ ¸í·É¾î¸¦ Áö¿øÇÑ´Ù.

MRI ½ºÅ©¸³Æ®´Â 3 ¼½¼Ç¸¸À» Áö¿øÇÏÁö ¾Ê±â ¶§¹®¿¡ ÀϹÝÀûÀ¸·Î MRI´Â ½ºÅ©¸³Æ®¸¦ a.out ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½Ä°ú »ç¿ëÇÏÁö ¾Ê´Â´Ù.

You can specify a file containing an MRI-compatible script using the `-c' command-line option.

Each command in an MRI-compatible script occupies its own line; each command line starts with the keyword that identifies the command (though blank lines are also allowed for punctuation). If a line of an MRI-compatible script begins with an unrecognized keyword, ld issues a warning message, but continues processing the script.

MRI ȣȯ ½ºÅ©¸³Æ® ÆÄÀÏÀ» `-c' ¿É¼ÇÀ¸·Î ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.

°¢ ¸í·É¾î´Â ÇÑ ÁÙÀ» Â÷ÁöÇÑ´Ù. °¢ ¸í·ÉÁÙÀº ¸í·É¾î¸¦ ÁöĪÇÏ´Â Å°¿öµå·Î ½ÃÀÛÇÑ´Ù. (ºóÁÙµµ Çã¿ëµÈ´Ù.) ÁÙÀÌ MRI ȣȯ ½ºÅ©¸³Æ®°¡ ÀνÄÇÒ ¼ö ¾ø´Â Å°¿öµå·Î ½ÃÀÛÇϸé ld´Â °æ°í¸¦ Ãâ·ÂÇÏÁö¸¸ °è¼Ó ó¸®ÇÑ´Ù.

Lines beginning with `*' are comments.

You can write these commands using all upper-case letters, or all lower case; for example, `chip' is the same as `CHIP'. The following list shows only the upper-case form of each command.

`*'·Î ½ÃÀÛÇÏ´Â ÁÙÀº ÁÖ¼®ÀÌ´Ù.

¸í·É¾î¸¦ ¸ðµÎ ´ë¹®ÀÚ È¤Àº ¸ðµÎ ¼Ò¹®ÀÚ·Î ÀûÀ» ¼ö ÀÖ´Ù. ¿¹¸¦ µé¾î `chip'°ú `CHIP'Àº °°´Ù. ´ÙÀ½ ¸ñ·Ï¿¡¼­´Â ´ë¹®Àڷθ¸ Ç¥±âÇß´Ù.

ABSOLUTE secname
ABSOLUTE secname, secname, ... secname
Normally, ld includes in the output file all sections from all the input files. However, in an MRI-compatible script, you can use the ABSOLUTE command to restrict the sections that will be present in your output program. If the ABSOLUTE command is used at all in a script, then only the sections named explicitly in ABSOLUTE commands will appear in the linker output. You can still use other input sections (whatever you select on the command line, or using LOAD) to resolve addresses in the output file.
º¸Åë ld´Â ¸ðµç ÀÔ·ÂÆÄÀÏÀÇ ¼½¼ÇÀ» Ãâ·ÂÆÄÀÏ¿¡ Æ÷ÇÔÇÑ´Ù. ±×·¯³ª MRI ȣȯ ½ºÅ©¸³Æ®¿¡¼­ ABSOLUTE ¸í·É¾îÀº Ãâ·Â ÇÁ·Î±×·¥¿¡ ³ª¿Ã ¼½¼ÇÀ» Á¦ÇÑÇÑ´Ù. ABSOLUTE ¸í·É¾î°¡ ½ºÅ©¸³Æ®¿¡ ÇѹøÀÌ¶óµµ ³ª¿À¸é ABSOLUTE ¸í·É¾î¿¡ ¸í½ÃÀûÀ¸·Î Áö½ÃÇÑ ¼½¼Ç¸¸ÀÌ Ãâ·Â¿¡ ³ªÅ¸³­´Ù. ±×·¡µµ Ãâ·ÂÆÄÀÏÀÇ ÁÖ¼Ò¸¦ ¸®Á¹ºêÇϱâ À§Çؼ­ ´Ù¸¥ (¸í·ÉÇàÀ̳ª LOAD ¸í·É¾î·Î ¼±ÅÃÇÑ) ÀÔ·Â ¼½¼ÇÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù.
ALIAS out-secname, in-secname
Use this command to place the data from input section in-secname in a section called out-secname in the linker output file. in-secname may be an integer.
ÀÔ·Â ¼½¼Ç in-secnameÀÇ ÀڷḦ Ãâ·ÂÆÄÀÏÀÇ ¼½¼Ç out-secname¿¡ À§Ä¡ÇÏ·Á¸é ÀÌ ¸í·É¾î¸¦ »ç¿ëÇÑ´Ù. in-secnameÀº Á¤¼öÀÏ ¼ö ÀÖ´Ù.
ALIGN secname = expression
Align the section called secname to expression. The expression should be a power of two.
¼½¼Ç secnameÀ» expressionÀ¸·Î Á¤·ÄÇÑ´Ù. expressionÀº 2ÀÇ Á¦°öÀ̾î¾ß ÇÑ´Ù.
BASE expression
Use the value of expression as the lowest address (other than absolute addresses) in the output file.
(Àý´ë ÁÖ¼Ò¸¦ Á¦¿ÜÇÏ°í) Ãâ·ÂÆÄÀÏÀÇ °¡Àå ÇÏÀ§ ÁÖ¼Ò·Î expression °ªÀ» »ç¿ëÇÑ´Ù.
CHIP expression
CHIP expression, expression
This command does nothing; it is accepted only for compatibility.
ÀÌ ¸í·É¾î´Â ȣȯÀ» À§ÇÑ °ÍÀ¸·Î ¾Æ¹« Àϵµ ÇÏÁö ¾Ê´Â´Ù.
END
This command does nothing whatever; it's only accepted for compatibility.
ÀÌ ¸í·É¾î´Â ȣȯÀ» À§ÇÑ °ÍÀ¸·Î ¾Æ¹« Àϵµ ÇÏÁö ¾Ê´Â´Ù.
FORMAT output-format
Similar to the OUTPUT_FORMAT command in the more general linker language, but restricted to one of these output formats:
  1. S-records, if output-format is `S'
  2. IEEE, if output-format is `IEEE'
  3. COFF (the `coff-m68k' variant in BFD), if output-format is `COFF'

ÀÏ¹Ý ¸µÄ¿ ¾ð¾îÀÇ OUTPUT_FORMAT ¸í·É¾î¿Í ºñ½ÁÇÏÁö¸¸ ´ÙÀ½ Áß Çϳª¸¸À» »ç¿ëÇÒ ¼ö ÀÖ´Ù.
  1. output-formatÀÌ `S'À̸é S-record
  2. output-formatÀÌ `IEEE'À̸é IEEE
  3. output-formatÀÌ `COFF'À̸é COFF (BFD¿¡¼­ `coff-m68k')
LIST anything...
Print (to the standard output file) a link map, as produced by the ld command-line option `-M'. The keyword LIST may be followed by anything on the same line, with no change in its effect.
ld ¿É¼Ç `-M'°ú °°ÀÌ (Ç¥ÁØÃâ·ÂÀ¸·Î) ¸µÅ©¸ÊÀ» Ãâ·ÂÇÑ´Ù. LIST Å°¿öµå ´ÙÀ½¿¡ ¾î¶² °Íµµ ¿Ã ¼ö ÀÖÁö¸¸ ¾Æ¹« Àǹ̵µ ¾ø´Ù.
LOAD filename
LOAD filename, filename, ... filename
Include one or more object file filename in the link; this has the same effect as specifying filename directly on the ld command line.
¸µÅ©¿¡ Çϳª ÀÌ»óÀÇ ¿ÀºêÁ§Æ® ÆÄÀÏ filenameÀ» Æ÷ÇÔÇÑ´Ù. ÀÌ´Â ld ¸í·ÉÇà¿¡ filenameÀ» Á÷Á¢ ½áÁØ °Í°ú µ¿ÀÏÇÏ´Ù.
NAME output-name
output-name is the name for the program produced by ld; the MRI-compatible command NAME is equivalent to the command-line option `-o' or the general script language command OUTPUT.
ld°¡ »ý¼ºÇÏ´Â ÇÁ·Î±×·¥ À̸§À¸·Î output-name¸¦ »ç¿ëÇÑ´Ù. ÀÌ´Â ¸í·ÉÇà ¿É¼Ç `-o'À̳ª ÀÏ¹Ý ½ºÅ©¸³Æ® ¸í·É¾î OUTPUT¿Í µ¿ÀÏÇÏ´Ù.
ORDER secname, secname, ... secname
ORDER secname secname secname
Normally, ld orders the sections in its output file in the order in which they first appear in the input files. In an MRI-compatible script, you can override this ordering with the ORDER command. The sections you list with ORDER will appear first in your output file, in the order specified.
º¸Åë ld´Â ÀÔ·ÂÆÄÀÏ¿¡ ³ª¿À´Â ¼ø¼­·Î Ãâ·ÂÆÄÀÏ¿¡ ¼½¼ÇÀ» ¹èÄ¡ÇÑ´Ù. ORDER ¸í·É¾î·Î ÀÌ ¼ø¼­¸¦ º¯°æÇÒ ¼ö ÀÖ´Ù. ORDER·Î ¿­°ÅÇÑ ¼½¼ÇÀº Ãâ·ÂÆÄÀÏÀÇ ½ÃÀÛ¿¡¼­ºÎÅÍ ¼ø¼­´ë·Î À§Ä¡ÇÑ´Ù.
PUBLIC name=expression
PUBLIC name,expression
PUBLIC name expression
Supply a value (expression) for external symbol name used in the linker input files.
ÀÔ·ÂÆÄÀÏ¿¡¼­ »ç¿ëÇÏ´Â ¿ÜºÎ ½Éº¼ nameÀÇ °ªÀ¸·Î expressionÀ» »ç¿ëÇÑ´Ù.
SECT secname, expression
SECT secname=expression
SECT secname expression
You can use any of these three forms of the SECT command to specify the start address (expression) for section secname. If you have more than one SECT statement for the same secname, only the first sets the start address.
¼½¼Ç secnameÀÇ ½ÃÀÛ ÁÖ¼Ò·Î expression¸¦ »ç¿ëÇÑ´Ù. °°Àº secname¿¡ ´ëÇØ ¿©·¯ SECT ¸í·É¾î¸¦ »ç¿ëÇϸé óÀ½ °ÍÀ¸·Î ½ÃÀÛ ÁÖ¼Ò¸¦ Á¤ÇÑ´Ù.


Go to the first, previous, next, last section, table of contents.