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
MRI ¸µÄ¿¸¦ »ç¿ëÇÏ´Ù°¡ GNU
MRI ½ºÅ©¸³Æ®´Â 3 ¼½¼Ç¸¸À» Áö¿øÇÏÁö ¾Ê±â ¶§¹®¿¡
ÀϹÝÀûÀ¸·Î MRI´Â ½ºÅ©¸³Æ®¸¦ a.out
object
file format, since it only has three sections and MRI scripts lack some
features to make use of them.
ld
·Î º¯°æÇÏ´Â »ç¿ëÀÚ¸¦ À§Çؼ
ld
´Â Linker Scripts¿¡ ¼³¸íµÈ
´õ ¹ü¿ëÀÇ ¸µÄ¿ ½ºÅ©¸³Æ® ¾ð¾î¿¡ ¿Ü¿¡ MRI ȣȯ ¸µÄ¿ ½ºÅ©¸³Æ®µµ »ç¿ëÇÑ´Ù.
MRI ȣȯ ¸µÄ¿ ½ºÅ©¸³Æ®´Â ld
½ºÅ©¸³Æ® ¾ð¾î¿¡ ºñÇØ ¸Å¿ì °£´ÜÇÑ
¸í·É¾î¸¦ °¡Áø´Ù. GNU ld
´Â ´ëºÎºÐÀÇ 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,
MRI ȣȯ ½ºÅ©¸³Æ® ÆÄÀÏÀ» `-c' ¿É¼ÇÀ¸·Î ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.
°¢ ¸í·É¾î´Â ÇÑ ÁÙÀ» Â÷ÁöÇÑ´Ù. °¢ ¸í·ÉÁÙÀº ¸í·É¾î¸¦ ÁöĪÇÏ´Â Å°¿öµå·Î ½ÃÀÛÇÑ´Ù.
(ºóÁÙµµ Çã¿ëµÈ´Ù.) ÁÙÀÌ MRI ȣȯ ½ºÅ©¸³Æ®°¡ ÀνÄÇÒ ¼ö ¾ø´Â Å°¿öµå·Î ½ÃÀÛÇϸé
ld
issues a warning message, but continues processing the script.
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
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
ALIGN secname = expression
BASE expression
CHIP expression
CHIP expression, expression
END
FORMAT output-format
OUTPUT_FORMAT
command in the more general linker
language, but restricted to one of these output formats:
OUTPUT_FORMAT
¸í·É¾î¿Í ºñ½ÁÇÏÁö¸¸ ´ÙÀ½ Áß Çϳª¸¸À»
»ç¿ëÇÒ ¼ö ÀÖ´Ù.
LIST anything...
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
ld
command line.
ld
¸í·ÉÇà¿¡ filenameÀ» Á÷Á¢ ½áÁØ °Í°ú µ¿ÀÏÇÏ´Ù.
NAME output-name
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
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
SECT secname, expression
SECT secname=expression
SECT secname expression
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.
SECT
¸í·É¾î¸¦ »ç¿ëÇϸé
óÀ½ °ÍÀ¸·Î ½ÃÀÛ ÁÖ¼Ò¸¦ Á¤ÇÑ´Ù.
Go to the first, previous, next, last section, table of contents.