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


½ÇÇà

The GNU linker ld is meant to cover a broad range of situations, and to be as compatible as possible with other linkers. As a result, you have many choices to control its behavior.

GNU ¸µÄ¿ÀÎ ld´Â ±¤¹üÀ§ÇÑ ¿ëµµ·Î »ç¿ëµÇ°í, °¡´ÉÇÑ ´Ù¸¥ ¸µÄ¿µé°ú ȣȯÀÌ µÇ°Ô ¼³°èµÇ¾ú´Ù. ÀÌ °á°ú·Î ½ÇÇàÀ» Á¦¾îÇÏ´Â ¸¹Àº ¿É¼ÇÀ» °¡Áø´Ù.

¸í·ÉÇà ¿É¼Ç

The linker supports a plethora of command-line options, but in actual practice few of them are used in any particular context. For instance, a frequent use of ld is to link standard Unix object files on a standard, supported Unix system. On such a system, to link a file hello.o:

¸µÄ¿¿¡´Â ¸Å¿ì ¸¹Àº ¸í·ÉÇà ¿É¼ÇÀÌ ÀÖÁö¸¸, ½ÇÁ¦ »ç¿ëµÇ´Â °ÍÀº ¼Ò¼öÀÌ´Ù. ¿¹¸¦ µé¸é, ldÀÇ ÈçÇÑ ¿ëµµ´Â À¯´Ð½º ½Ã½ºÅÛ¿¡¼­ Ç¥ÁØ À¯´Ð½º ¿ÀºêÁ§Æ® ÆÄÀÏÀ» ¸µÅ©ÇÏ´Â °ÍÀÌ´Ù. ÀÌ °æ¿ì hello.o ÆÄÀÏÀ» ¸µÅ©ÇÏ¿©¸é,

ld -o output /lib/crt0.o hello.o -lc

This tells ld to produce a file called output as the result of linking the file /lib/crt0.o with hello.o and the library libc.a, which will come from the standard search directories. (See the discussion of the `-l' option below.)

À§¿¡¼­ ld´Â /lib/crt0.o, hello.o¿Í Ç¥ÁØ °Ë»ö µð·ºÅ丮¿¡ ÀÖ´Â ¶óÀ̺귯¸® libc.a¸¦ ¸µÅ©ÇÏ¿© °á°ú·Î output¸¦ ¸¸µç´Ù. (`-l' ¿É¼ÇÀº ¾Æ·¡¼­ ¼³¸íµÈ´Ù.)

Some of the command-line options to ld may be specified at any point in the command line. However, options which refer to files, such as `-l' or `-T', cause the file to be read at the point at which the option appears in the command line, relative to the object files and other file options. Repeating non-file options with a different argument will either have no further effect, or override prior occurrences (those further to the left on the command line) of that option. Options which may be meaningfully specified more than once are noted in the descriptions below.

¿©·¯ ¸í·ÉÇà ¿É¼ÇÀº ¸í·ÉÇà¿¡¼­ ¾Æ¹« °÷À̳ª À§Ä¡Çصµ µÈ´Ù. ±×·¯³ª `-l'³ª `-T'¿Í °°ÀÌ ÆÄÀÏ°ú °ü·ÃµÈ ¿É¼ÇÀÇ °æ¿ì, ¸í·ÉÇà¿¡¼­ ¿É¼ÇÀÇ ¼ø¼­´ë·Î ÆÄÀÏÀ» Àд´Ù. ÆÄÀÏ°ú °ü·ÃÀÌ ¾ø´Â ¿É¼ÇÀ» ¼­·Î ´Ù¸¥ ¾Æ±Ô¸ÕÆ®¸¦ °¡Áö°í ¿©·¯¹ø »ç¿ëÇÏ¸é ¹«È¿°¡ µÇ°Å³ª (¸í·ÉÇàÀÇ ¿ÞÂÊ) ÀüÀÇ ¿É¼ÇÀ» ¹«½ÃÇÑ´Ù. ¿©·¯¹ø ¹Ýº¹µÇµµ µÇ´Â ¿É¼ÇÀº ¾Æ·¡ ¿É¼Ç ¼³¸í¿¡ ¸í½ÃµÈ´Ù.

Non-option arguments are object files or archives which are to be linked together. They may follow, precede, or be mixed in with command-line options, except that an object file argument may not be placed between an option and its argument.

¿É¼ÇÀÌ ¾Æ´Ñ ¾Æ±Ô¸ÕÆ®´Â ¿ÀºêÁ§Æ® ÆÄÀÏÀ̰ųª °°ÀÌ ¸µÅ©µÉ ¾ÆÄ«À̺ê ÆÄÀÏÀÌ´Ù. À̵éÀº ¿É¼Ç°ú ¿É¼ÇÀÇ ¾Æ±Ô¸ÕÆ® »çÀ̸¦ Á¦¿ÜÇÏ°í´Â ¸í·ÉÇà ¾îµð¿¡µµ À§Ä¡ÇÒ ¼ö ÀÖ´Ù.

Usually the linker is invoked with at least one object file, but you can specify other forms of binary input files using `-l', `-R', and the script command language. If no binary input files at all are specified, the linker does not produce any output, and issues the message `No input files'.

¸µÄ¿´Â º¸Åë ÃÖ¼ÒÇÑ ÇÑ ¿ÀºêÁ§Æ® ÆÄÀÏÀ» °¡Áö°í ½ÇÇàµÈ´Ù. ±×·¯³ª `-l', `-R' ¿É¼ÇÀ̳ª ½ºÅ©¸³Æ® ¸í·É ¾ð¾î·Îµµ ÀÔ·Â ÆÄÀÏÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù. ¾î¶² ÀÌÁø ÀÔ·Â ÆÄÀϵµ ÁÖ¾îÁöÁö ¾Ê´Ù¸é, ¸µÄ¿´Â ¾î¶² Ãâ·Â ÆÄÀϵµ ¸¸µéÁö¾Ê°í `No input files'¶ó°í Ãâ·ÂÀ» ÇÑ´Ù.

If the linker can not recognize the format of an object file, it will assume that it is a linker script. A script specified in this way augments the main linker script used for the link (either the default linker script or the one specified by using `-T'). This feature permits the linker to link against a file which appears to be an object or an archive, but actually merely defines some symbol values, or uses INPUT or GROUP to load other objects. Note that specifying a script in this way should only be used to augment the main linker script; if you want to use some command that logically can only appear once, such as the SECTIONS or MEMORY command, you must replace the default linker script using the `-T' option. See section Linker Scripts.

¸µÄ¿°¡ ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½ÄÀ» ¾Ë¾Æ³»Áö ¸øÇϸé, À̸¦ ¸µÄ¿ ½ºÅ©¸³Æ®·Î °£ÁÖÇÑ´Ù. ÀÌ·¸°Ô ÁÖ¾îÁø ½ºÅ©¸³Æ®´Â ÁÖ ¸µÄ¿ ½ºÅ©¸³Æ®¸¦ (±âº» ¸µÄ¿ ½ºÅ©¸³Æ®³ª `-T' ¿É¼ÇÀ¸·Î ÁöÁ¤ÇÑ ½ºÅ©¸³Æ®) º¸¿ÏÇÑ´Ù. ÀÌ·± ½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇÏ¿© ¿ÀºêÁ§Æ® ÆÄÀÏÀ̳ª ¾ÆÄ«À̺ê ÆÄÀÏó·³ º¸ÀÌ´Â ÆÄÀϵéÀ» ¸µÅ©ÇÒ ¼ö ÀÖÁö¸¸, ½ÇÁ¦·Î ½Éº¼°ªÀ» Á¤ÀÇÇϰųª ´Ù¸¥ ¿ÀºêÁ§Æ®¸¦ ÀоîµéÀ̱â À§ÇØ INPUT, GROUPÀ» »ç¿ëÇÑ´Ù. ÀÌ·¸°Ô ÁÖ¾îÁø ½ºÅ©¸³Æ®´Â ÁÖ ¸µÄ¿ ½ºÅ©¸³Æ®¸¦ º¸¿ÏÇϴµ¥¸¸ »ç¿ëµÇ´Â °ÍÀ» ÁÖÀÇÇ϶ó. ¸¸¾à SECTIONS³ª MEMORY ¸í·É¾î¿Í °°ÀÌ Àǹ̻ó Çѹø¸¸ ³ª¿Í¾ßÇÏ´Â ¸í·É¾î¸¦ »ç¿ëÇØ¾ß ÇÑ´Ù¸é, `-T' ¿É¼ÇÀ¸·Î ±âº» ¸µÄ¿ ½ºÅ©¸³Æ®¸¦ ´ëüÇØ¾ß ÇÑ´Ù. Linker Scripts¸¦ Âü°íÇ϶ó.

For options whose names are a single letter, option arguments must either follow the option letter without intervening whitespace, or be given as separate arguments immediately following the option that requires them.

À̸§ÀÌ ÇÑ ¹®ÀÚÀÎ ¿É¼ÇÀÇ ¾Æ±Ô¸ÕÆ®´Â °ø¹é ¾øÀÌ ¿É¼Ç ¹®ÀÚ ¹Ù·Î µÚ¿¡ Àû°Å³ª ¿É¼Ç µÚ¿¡ ¾Æ±Ô¸ÕÆ®·Î Àû¾îÁÖ¸é µÈ´Ù.

For options whose names are multiple letters, either one dash or two can precede the option name; for example, `-trace-symbol' and `--trace-symbol' are equivalent. Note - there is one exception to this rule. Multiple letter options that start with a lower case 'o' can only be preceeded by two dashes. This is to reduce confusion with the `-o' option. So for example `-omagic' sets the output file name to `magic' whereas `--omagic' sets the NMAGIC flag on the output.

À̸§ÀÌ ¿©·¯ ¹®ÀÚÀÎ ¿É¼ÇÀº ¿É¼Ç À̸§ ¾Õ¿¡ Çϳª³ª µÎ°³ÀÇ »©±â ±âÈ£¸¦ ¾´´Ù. ¿¹¸¦ µé¾î, `-trace-symbol'¿Í `--trace-symbol'´Â µ¿ÀÏÇÏ´Ù. ÁÖÀÇ! ÀÌ ±ÔÄ¢¿¡ ¿¹¿Ü°¡ ÀÖ´Ù. ¿©·¯ ¹®ÀÚ ¿É¼ÇÀÌ ¼Ò¹®ÀÚ 'o'·Î ½ÃÀÛÇϸé `-o ¿É¼Ç°ú È¥µ¿À» ÇÇÇϱâ À§Çؼ­ »©±â ±âÈ£¸¦ µÎ°³ ½áÁà¾ß ÇÑ´Ù. ±×·¡¼­ `-omagicÀº Ãâ·Â ÆÄÀÏÀ̸§À» `magic'À¸·Î ÇÏ°í, `--omagic'Àº Ãâ·Â¿¡ NMAGIC Ç÷¡±×¸¦ ¼³Á¤ÇÑ´Ù.

Arguments to multiple-letter options must either be separated from the option name by an equals sign, or be given as separate arguments immediately following the option that requires them. For example, `--trace-symbol foo' and `--trace-symbol=foo' are equivalent. Unique abbreviations of the names of multiple-letter options are accepted.

¿©·¯ ¹®ÀÚ ¿É¼ÇÀÇ ¾Æ±Ô¸ÕÆ®´Â ¿É¼Ç°ú µîÈ£·Î ¿¬°áµÇ°Å³ª ¿É¼Ç µÚ¿¡ µ¶¸³µÈ ¾Æ±Ô¸ÕÆ®·Î ÁÖ¾îÁø´Ù. ¿¹¸¦ µé¾î, `--trace-symbol foo'¿Í `--trace-symbol=foo'´Â µ¿ÀÏÇÏ´Ù. ¿©·¯ ¹®ÀÚ ¿É¼ÇÀÇ ÁÙÀÎ À̸§µµ ÀÖ´Ù.

Note - if the linker is being invoked indirectly, via a compiler driver (eg `gcc') then all the linker command line options should be prefixed by `-Wl,' (or whatever is appropriate for the particular compiler driver) like this:

ÁÖÀÇ! ¸µÄ¿°¡ `gcc' °°Àº ÄÄÆÄÀÏ·¯ µå¶óÀ̹ö¿¡ ÀÇÇØ °£Á¢ÀûÀ¸·Î ½ÇÇàµÈ´Ù¸é, ´ÙÀ½°ú °°ÀÌ ¸µÄ¿ ¿É¼Ç ¾Õ¿¡ `-Wl,'À» (ȤÀº ƯÁ¤ ÄÄÆÄÀÏ·¯ µå¶óÀ̹ö¿¡ ÇØ´çÇÏ´Â) ºÙ¿©¾ß ÇÑ´Ù.

  gcc -Wl,--startgroup foo.o bar.o -Wl,--endgroup

This is important, because otherwise the compiler driver program may silently drop the linker options, resulting in a bad link.

±×·¸Áö ¾ÊÀ¸¸é ÄÄÆÄÀÏ·¯ µå¶óÀ̹ö ÇÁ·Î±×·¥ÀÌ ¸µÄ¿ ¿É¼ÇÀ» ¹«½ÃÇÏ¿© ¸µÅ©¸¦ À߸øÇÏ°Ô µÈ´Ù.

Here is a table of the generic command line switches accepted by the GNU linker:

´ÙÀ½Àº GNU ¸µÄ¿ÀÇ ÀÏ¹Ý ¸í·ÉÇà ¿É¼ÇµéÀÌ´Ù.

-akeyword
This option is supported for HP/UX compatibility. The keyword argument must be one of the strings `archive', `shared', or `default'. `-aarchive' is functionally equivalent to `-Bstatic', and the other two keywords are functionally equivalent to `-Bdynamic'. This option may be used any number of times.
HP/UX¿Í ȣȯÀ» À§ÇÑ ¿É¼ÇÀÌ´Ù. keyword ¾Æ±Ô¸ÕÆ®´Â `archive', `shared', `default' Áß ÇϳªÀÌ´Ù. `-aarchive'´Â ±â´É»ó `-Bstatic'°ú µ¿ÀÏÇÏ°í, ´Ù¸¥ µÎ ¿É¼ÇÀº `-Bdynamic'°ú µ¿ÀÏÇÏ´Ù. ÀÌ ¿É¼ÇÀº ¿©·¯¹ø »ç¿ëÇÒ ¼ö ÀÖ´Ù.
-Aarchitecture
--architecture=architecture
In the current release of ld, this option is useful only for the Intel 960 family of architectures. In that ld configuration, the architecture argument identifies the particular architecture in the 960 family, enabling some safeguards and modifying the archive-library search path. See section ld and the Intel 960 family, for details. Future releases of ld may support similar functionality for other architecture families.
ÇöÀç´Â Intel 960 ¾ÆÅ°ÅØÃÄ¿¡¼­¸¸ »ç¿ëµÈ´Ù. ÀÌ °æ¿ì architecture ¾Æ±Ô¸ÕÆ®´Â 960 °è¿­¿¡¼­ ƯÁ¤ ¾ÆÅ°ÅØÃĸ¦ ÁöÁ¤ÇÏ¿© ¸î¸î ¾ÈÀüÃ¥À» »ç¿ëÇÏ°í ¾ÆÄ«ÀÌºê ¶óÀ̺귯¸® °Ë»ö °æ·Î¸¦ ¼öÁ¤ÇÑ´Ù. ÀÚ¼¼ÇÑ Á¤º¸´Â ld and the Intel 960 familyÀ» Âü°íÇ϶ó. ¾ÕÀ¸·Î ´Ù¸¥ ¾ÆÅ°ÅØÃÄ °è¿­¿¡¼­µµ ºñ½ÁÇÑ ±â´ÉÀ» Áö¿øÇÒ ¼ö ÀÖ´Ù.
-b input-format
--format=input-format
ld may be configured to support more than one kind of object file. If your ld is configured this way, you can use the `-b' option to specify the binary format for input object files that follow this option on the command line. Even when ld is configured to support alternative object formats, you don't usually need to specify this, as ld should be configured to expect as a default input format the most usual format on each machine. input-format is a text string, the name of a particular format supported by the BFD libraries. (You can list the available binary formats with `objdump -i'.) See section BFD. You may want to use this option if you are linking files with an unusual binary format. You can also use `-b' to switch formats explicitly (when linking object files of different formats), by including `-b input-format' before each group of object files in a particular format. The default format is taken from the environment variable GNUTARGET. See section Environment Variables. You can also define the input format from a script, using the command TARGET; see section Commands dealing with object file formats.
ld´Â ¿©·¯°³ÀÇ ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½ÄÀ» Áö¿øÇÒ ¼ö ÀÖ´Ù. ¸¸¾à ±×·¸´Ù¸é `-b' ¿É¼ÇÀ¸·Î ÀÌ ¿É¼Ç µÚ¿¡ ³ª¿À´Â ÀÔ·Â ¿ÀºêÁ§Æ® ÆÄÀÏÀÇ Çü½ÄÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù. ±×·¯³ª À̸¦ ÁöÁ¤ÇÏÁö ¾Ê¾Æµµ ld´Â °¢ Ç÷¡Æû¿¡¼­ °¡Àå ¸¹ÀÌ ¾²ÀÌ´Â Çü½ÄÀ» ±âº» Çü½ÄÀ¸·Î °í·ÁÇÑ´Ù. input-formatÀº ¹®ÀÚ¿­·Î BFD ¶óÀ̺귯¸®°¡ Áö¿øÇÏ´Â Çü½ÄÀÇ À̸§ÀÌ´Ù. (°¡´ÉÇÑ Çü½ÄÀº `objdump -i'·Î È®ÀÎÇÒ ¼ö ÀÖ´Ù.) BFD¸¦ ÂüÁ¶Ç϶ó. º¸Åë ¸¹ÀÌ ¾²ÀÌÁö ¾Ê´Â Çü½ÄÀÇ ÆÄÀÏÀ» ¸µÅ©ÇÒ ¶§, ÀÌ ¿É¼ÇÀ» »ç¿ëÇÑ´Ù. ¶Ç, ¿©·¯ ´Ù¸¥ Çü½ÄÀÇ ¿ÀºêÁ§Æ® ÆÄÀÏÀ» ¸µÅ©ÇÒ ¶§ °¢ Çü½ÄÀÇ ¿ÀºêÁ§Æ® ÆÄÀÏµé ¾Õ¿¡ `-b input-format'¸¦ »ç¿ëÇÏ¿© ¸í½ÃÀûÀ¸·Î Çü½ÄÀ» º¯È¯ÇÒ ¼ö ÀÖ´Ù. ±âº» Çü½ÄÀº ȯ°æº¯¼ö GNUTARGET¿¡¼­ ÀоîµéÀδÙ. Environment Variables¸¦ Âü°íÇ϶ó. ¶Ç, TARGET ¸í·É¾î¸¦ »ç¿ëÇÏ¿© ½ºÅ©¸³Æ®¿¡¼­ ÀÔ·Â Çü½ÄÀ» Á¤ÀÇÇÒ ¼öµµ ÀÖ´Ù. Commands dealing with object file formats¸¦ Âü°íÇ϶ó.
-c MRI-commandfile
--mri-script=MRI-commandfile
For compatibility with linkers produced by MRI, ld accepts script files written in an alternate, restricted command language, described in section MRI Compatible Script Files. Introduce MRI script files with the option `-c'; use the `-T' option to run linker scripts written in the general-purpose ld scripting language. If MRI-cmdfile does not exist, ld looks for it in the directories specified by any `-L' options.
MRI ¸µÄ¿¿Í ȣȯÀ» À¯ÁöÇϱâ À§Çؼ­ ld´Â MRI Compatible Script Files¿¡ ¼³¸íµÈ º°µµÀÇ Á¦ÇÑµÈ ¸í·É ¾ð¾î¸¦ ¹Þ¾ÆµéÀδÙ. MRI ½ºÅ©¸³Æ® ÆÄÀÏÀº `-c' ¿É¼Ç°ú ÇÔ²² »ç¿ëÇÑ´Ù. (¹ü¿ë ld ½ºÅ©¸³Æ® ¾ð¾î·Î ¾²¿©Áø ÆÄÀÏÀº `-T' ¿É¼Ç°ú ÇÔ²² »ç¿ëÇÑ´Ù.) MRI-cmdfileÀ» ãÁö¸øÇϸé, `-L' ¿É¼ÇÀ¸·Î ÁöÁ¤ÇÑ µð·ºÅ丮¿¡¼­ ã´Â´Ù.
-d
-dc
-dp
These three options are equivalent; multiple forms are supported for compatibility with other linkers. They assign space to common symbols even if a relocatable output file is specified (with `-r'). The script command FORCE_COMMON_ALLOCATION has the same effect. See section Other linker script commands.
ÀÌ ¼¼ ¿É¼ÇÀº ´Ù¸¥ ¸µÄ¿µé°ú ȣȯÀ» À§ÇÑ °ÍÀ¸·Î µ¿ÀÏÇÑ ±â´ÉÀ» ÇÑ´Ù. À̵éÀº (`-r' ¿É¼ÇÀ¸·Î) Àç¹èÄ¡°¡´ÉÇÑ Ãâ·Â ÆÄÀÏÀÌ ÁöÁ¤µÇ¾ú¾îµµ °øÅë ½Éº¼(common symbol, ¿ªÁÖ; pascalÀÇ common block¿¡¼­ À¯·¡ÇÑ °ÍÀ¸·Î, CÀÇ °æ¿ì º¸Åë ÃʱâÈ­ÇÏÁö ¾ÊÀº Àü¿ªº¯¼ö¸¦ ¿ÀºêÁ§Æ® ÆÄÀÏ¿¡ °øÅë ½Éº¼·Î ÀúÀåÇÑ´Ù.)¿¡ °ø°£À» ÇÒ´çÇÑ´Ù. ½ºÅ©¸³Æ® ¸í·É¾î FORCE_COMMON_ALLOCATIONµµ °°Àº ±â´ÉÀ» ÇÑ´Ù. Other linker script commands¸¦ ÂüÁ¶Ç϶ó.
-e entry
--entry=entry
Use entry as the explicit symbol for beginning execution of your program, rather than the default entry point. If there is no symbol named entry, the linker will try to parse entry as a number, and use that as the entry address (the number will be interpreted in base 10; you may use a leading `0x' for base 16, or a leading `0' for base 8). See section Setting the entry point, for a discussion of defaults and other ways of specifying the entry point.
ÇÁ·Î±×·¥ÀÇ ½ÇÇà ½ÃÀÛ ½Éº¼·Î ±âº»°ª ´ë½Å¿¡ entry¸¦ »ç¿ëÇÑ´Ù. entry¶õ ½Éº¼ÀÌ ¾ø´Ù¸é ¸µÄ¿´Â À̸¦ ¼ýÀÚ·Î Çؼ®ÇÑ´Ù. (±âº»ÀûÀ¸·Î 10 Áø¼ö·Î Çؼ®µÈ´Ù. 16Áø¼ö´Â `0x', 8Áø¼ö´Â `0'¸¦ ¾Õ¿¡ ºÙ¿©¾ß ÇÑ´Ù.) ½ÇÇà ½ÃÀÛÁ¡¿¡ ´ëÇؼ­´Â Setting the entry point¸¦ Âü°íÇ϶ó.
-E
--export-dynamic
When creating a dynamically linked executable, add all symbols to the dynamic symbol table. The dynamic symbol table is the set of symbols which are visible from dynamic objects at run time. If you do not use this option, the dynamic symbol table will normally contain only those symbols which are referenced by some dynamic object mentioned in the link. If you use dlopen to load a dynamic object which needs to refer back to the symbols defined by the program, rather than some other dynamic object, then you will probably need to use this option when linking the program itself.
µ¿Àû ¸µÅ©µÈ ½ÇÇàÆÄÀÏÀ» ¸¸µé ¶§ ¸ðµç ½Éº¼À» µ¿Àû ½Éº¼Ç¥¿¡ Ãß°¡ÇÑ´Ù. µ¿Àû ½Éº¼Ç¥´Â ½ÇÇà Áß º¼ ¼ö ÀÖ´Â µ¿Àû °´Ã¼ÀÇ ½Éº¼µéÀÌ´Ù. ÀÌ ¿É¼ÇÀ» »ç¿ëÇÏÁö ¾ÊÀ¸¸é, µ¿Àû ½Éº¼Ç¥´Â ¸µÅ©¿¡¼­ ¾ð±ÞµÈ µ¿Àû °´Ã¼¿¡¼­ ÂüÁ¶ÇÏ´Â ½Éº¼¸¸À» Æ÷ÇÔÇÑ´Ù. ¸¸¾à dlopenÀ» »ç¿ëÇÏ¿© ÇÁ·Î±×·¥¿¡¼­ Á¤ÀÇÇÑ ½Éº¼À» ³ªÁß¿¡ ÂüÁ¶ÇÏ´Â µ¿Àû °´Ã¼¸¦ ÀоîµéÀÎ´Ù¸é ¾Æ¸¶µµ ÀÌ ¿É¼ÇÀÌ ÇÊ¿äÇÒ °ÍÀÌ´Ù.
-EB
Link big-endian objects. This affects the default output format.
big-endian °´Ã¼¸¦ ¸µÅ©ÇÑ´Ù. ±âº» Ãâ·ÂÇü½Ä¿¡ ¿µÇâÀ» ÁØ´Ù.
-EL
Link little-endian objects. This affects the default output format.
little-endian °´Ã¼¸¦ ¸µÅ©ÇÑ´Ù. ±âº» Ãâ·ÂÇü½Ä¿¡ ¿µÇâÀ» ÁØ´Ù.
-f
--auxiliary name
When creating an ELF shared object, set the internal DT_AUXILIARY field to the specified name. This tells the dynamic linker that the symbol table of the shared object should be used as an auxiliary filter on the symbol table of the shared object name. If you later link a program against this filter object, then, when you run the program, the dynamic linker will see the DT_AUXILIARY field. If the dynamic linker resolves any symbols from the filter object, it will first check whether there is a definition in the shared object name. If there is one, it will be used instead of the definition in the filter object. The shared object name need not exist. Thus the shared object name may be used to provide an alternative implementation of certain functions, perhaps for debugging or for machine specific performance. This option may be specified more than once. The DT_AUXILIARY entries will be created in the order in which they appear on the command line.
ELF °øÀ¯ °´Ã¼¸¦ ¸¸µé ¶§ ³»ºÎ DT_AUXILIARY Çʵ带 nameÀ¸·Î ¼³Á¤ÇÑ´Ù. ±×·¯¸é µ¿Àû ¸µÄ¿´Â °øÀ¯ °´Ã¼ÀÇ ½Éº¼Ç¥¸¦ nameÀ̶ó´Â °øÀ¯ °´Ã¼ÀÇ ½Éº¼Ç¥¿¡ ´ëÇÑ ºÎ¼öÀûÀÎ ÇÊÅÍ·Î »ç¿ëÇÑ´Ù. ³ªÁß¿¡ ÀÌ ÇÊÅÍ °´Ã¼¿Í ¸µÅ©ÇÑ ÇÁ·Î±×·¥À» ½ÇÇàÇÏ¸é µ¿Àû ¸µÄ¿´Â DT_AUXILIARY Çʵ带 ã´Â´Ù. µ¿Àû ¸µÄ¿°¡ ÇÊÅÍ °´Ã¼¿¡¼­ ¾î¶² ½Éº¼À» ã´Â´Ù¸é ¸ÕÀú nameÀ̶ó´Â °øÀ¯ °´Ã¼¿¡ Á¤ÀÇ°¡ ÀÖ´ÂÁö È®ÀÎÇÑ´Ù. ¸¸¾à ÀÖ´Ù¸é ÇÊÅÍ °´Ã¼ÀÇ Á¤ÀÇ ´ë½Å¿¡ »ç¿ëÇÑ´Ù. nameÀ̶ó´Â °øÀ¯ °´Ã¼´Â ¾ø¾îµµ µÈ´Ù. ±×·¡¼­ nameÀ̶ó´Â °øÀ¯ °´Ã¼´Â µð¹ö±ëÀ̳ª ƯÀ¯ÀÇ ¼º´ÉÀ» À§ÇÑ ÇÔ¼öÀÇ ´Ù¸¥ ±¸ÇöÀ» Á¦°øÇÒ ¼ö ÀÖ´Ù.
-F name
--filter name
When creating an ELF shared object, set the internal DT_FILTER field to the specified name. This tells the dynamic linker that the symbol table of the shared object which is being created should be used as a filter on the symbol table of the shared object name. If you later link a program against this filter object, then, when you run the program, the dynamic linker will see the DT_FILTER field. The dynamic linker will resolve symbols according to the symbol table of the filter object as usual, but it will actually link to the definitions found in the shared object name. Thus the filter object can be used to select a subset of the symbols provided by the object name. Some older linkers used the -F option throughout a compilation toolchain for specifying object-file format for both input and output object files. The GNU linker uses other mechanisms for this purpose: the -b, --format, --oformat options, the TARGET command in linker scripts, and the GNUTARGET environment variable. The GNU linker will ignore the -F option when not creating an ELF shared object.
ELF °øÀ¯ °´Ã¼¸¦ ¸¸µé ¶§ ³»ºÎ DT_FILTER Çʵ带 nameÀ¸·Î ¼³Á¤ÇÑ´Ù. ±×·¯¸é µ¿Àû ¸µÄ¿´Â »ý¼ºÇÒ °øÀ¯ °´Ã¼ÀÇ ½Éº¼Ç¥¸¦ nameÀ̶ó´Â °øÀ¯ °´Ã¼ÀÇ ½Éº¼Ç¥¿¡ ÇÊÅÍ·Î »ç¿ëÇÑ´Ù. ³ªÁß¿¡ ÀÌ ÇÊÅÍ °´Ã¼¿Í ¸µÅ©ÇÑ ÇÁ·Î±×·¥À» ½ÇÇàÇϸé, µ¿Àû ¸µÄ¿´Â DT_FILTER Çʵ带 ¹ß°ßÇÑ´Ù. µ¿Àû ¸µÄ¿´Â º¸Åë°ú °°ÀÌ °øÀ¯ °´Ã¼ÀÇ ½Éº¼Ç¥¿¡ ÇØ´çÇÏ´Â ½Éº¼À» ¸®Á¹ºêÇÏÁö¸¸, ½ÇÁ¦·Î nameÀ̶ó´Â °øÀ¯ °´Ã¼ÀÇ Á¤ÀÇ¿¡ ¸µÅ©ÇÑ´Ù. ±×·¡¼­ ÇÊÅÍ °´Ã¼´Â name °´Ã¼°¡ Á¦°øÇÏ´Â ½Éº¼ÀÇ ºÎºÐÁýÇÕÀ¸·Î »ç¿ëµÉ ¼ö ÀÖ´Ù. ¸î¸î ¿À·¡µÈ ¸µÄ¿´Â ÄÄÆÄÀÏ °úÁ¤¿¡¼­ ÀÔÃâ·Â ¿ÀºêÁ§Æ® ÆÄÀÏÀÇ Çü½ÄÀ» ÁöÁ¤Çϱâ À§ÇØ -F ¿É¼ÇÀ» »ç¿ëÇß´Ù. GNU ¸µÄ¿´Â ÀÌ ¸ñÀûÀ¸·Î, -b, --format, --oformat ¿É¼Ç°ú ½ºÅ©¸³Æ®¿¡¼­ TARGET ¸í·É¾î, ȯ°æº¯¼ö GNUTARGETÀ» »ç¿ëÇÑ´Ù. GNU ¸µÄ¿´Â ELF °øÀ¯ °´Ã¼¸¦ ¸¸µéÁö ¾Ê´Ù¸é -F ¿É¼ÇÀ» ¹«½ÃÇÑ´Ù.
-fini name

ELF ½ÇÇàÆÄÀÏÀ̳ª °øÀ¯ °´Ã¼¸¦ ¸¸µé´Â °æ¿ì, DT_FINI¸¦ ÇÔ¼ö nameÀÇ ÁÖ¼Ò·Î ¼³Á¤ÇÏ¿© ¾ð·ÎµåµÉ ¶§ nameÀ» È£ÃâÇÏ°Ô ÇÑ´Ù. ±âº»°ªÀ¸·Î _fini¸¦ »ç¿ëÇÑ´Ù.
-g
Ignored. Provided for compatibility with other tools.
¹«½ÃµÈ´Ù. ´Ù¸¥ µµ±¸¿Í ȣȯ¼ºÀ» À§ÇØ ÀÖ´Ù.
-Gvalue
--gpsize=value
Set the maximum size of objects to be optimized using the GP register to size. This is only meaningful for object file formats such as MIPS ECOFF which supports putting large and small objects into different sections. This is ignored for other object file formats.
GP ·¹Áö½ºÅ͸¦ »ç¿ëÇÏ¿© ÃÖÀûÈ­ÇÏ´Â °´Ã¼ÀÇ ÃÖ´ë Å©±â¸¦ size·Î ¼³Á¤ÇÑ´Ù. ÀÌ ¿É¼ÇÀº Å«°í ÀÛÀº °´Ã¼¸¦ ´Ù¸¥ ¼½¼Ç¿¡ Áý¾î³Ö´Â °ÍÀÌ °¡´ÉÇÑ MIPS ECOFF °°Àº Çü½Ä¿¡¸¸ Àǹ̰¡ ÀÖ´Ù. ´Ù¸¥ ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½Ä¿¡¼­´Â ¹«½ÃµÈ´Ù. (¿ªÁÖ; ÀÛÀº °´Ã¼µéÀ» ¸ð¾Æ¼­ º£À̽º ·¹Áö½ºÅÍ(GP, global pointer)¿¡¼­ °íÁ¤µÈ ¿É¼ÂÀ¸·Î °´Ã¼µéÀ» Á¢±ÙÇÒ ¶§ ¾²ÀδÙ. º¸Åë ÀÌµé °´Ã¼°¡ ÇÑ ¸Þ¸ð¸® ÆäÀÌÁö ¾È¿¡ µé¾î°¡¹Ç·Î ºü¸¥ Á¢±ÙÀÌ °¡´ÉÇÏ´Ù.)
-hname
-soname=name
When creating an ELF shared object, set the internal DT_SONAME field to the specified name. When an executable is linked with a shared object which has a DT_SONAME field, then when the executable is run the dynamic linker will attempt to load the shared object specified by the DT_SONAME field rather than the using the file name given to the linker.
ELF °øÀ¯ °´Ã¼¸¦ ¸¸µé ¶§, ³»ºÎ DT_SONAME Çʵ带 ÁöÁ¤ÇÑ nameÀ¸·Î ¼³Á¤ÇÑ´Ù. DT_SONAME Çʵ带 °¡Áø °øÀ¯ °´Ã¼¿Í ¸µÅ©µÈ ½ÇÇàÆÄÀÏÀÌ ½ÇÇàµÉ ¶§, µ¿Àû ¸µÄ¿´Â ¸µÄ¿¿¡ ÁÖ¾îÁø ÆÄÀÏÀ̸§ ´ë½Å¿¡ DT_SONAME Çʵ忡 ³ª¿Â °øÀ¯ °´Ã¼¸¦ ÀÐÀ¸·Á°í ½ÃµµÇÑ´Ù. (¿ªÁÖ; ÀÌ ¹æ½ÄÀ¸·Î °øÀ¯ ¶óÀ̺귯¸®ÀÇ ÃֽŠ¹öÀüÀ» »ç¿ëÇÏ°Ô µÈ´Ù.)
-i
Perform an incremental link (same as option `-r').
Áõ°¡Àû ¸µÅ©¸¦ ÇÑ´Ù. (`-r' ¿É¼Ç°ú °°´Ù.) (¿ªÁÖ; °³¹ßÁß ŸòÀº ¸µÅ©½Ã ¹Ù²ï ºÎºÐ¸¸ ¸µÅ©¸¦ ÇÏ¿© ¼Óµµ¸¦ Çâ»ó½ÃŲ´Ù.)
-init name
When creating an ELF executable or shared object, call NAME when the executable or shared object is loaded, by setting DT_INIT to the address of the function. By default, the linker uses _init as the function to call.
ELF ½ÇÇàÆÄÀÏÀ̳ª °øÀ¯ °´Ã¼¸¦ ¸¸µé´Â °æ¿ì, DT_INIT¸¦ ÇÔ¼ö nameÀÇ ÁÖ¼Ò·Î ¼³Á¤ÇÏ¿© ·ÎµåÇÒ ¶§ nameÀ» È£ÃâÇÑ´Ù. ±âº»°ªÀ¸·Î _init¸¦ »ç¿ëÇÑ´Ù.
-larchive
--library=archive
Add archive file archive to the list of files to link. This option may be used any number of times. ld will search its path-list for occurrences of libarchive.a for every archive specified. On systems which support shared libraries, ld may also search for libraries with extensions other than .a. Specifically, on ELF and SunOS systems, ld will search a directory for a library with an extension of .so before searching for one with an extension of .a. By convention, a .so extension indicates a shared library. The linker will search an archive only once, at the location where it is specified on the command line. If the archive defines a symbol which was undefined in some object which appeared before the archive on the command line, the linker will include the appropriate file(s) from the archive. However, an undefined symbol in an object appearing later on the command line will not cause the linker to search the archive again.
¸µÅ©ÇÒ ÆÄÀÏ ¸ñ·Ï¿¡ ¾ÆÄ«À̺ê ÆÄÀÏ archive¸¦ Ãß°¡ÇÑ´Ù. ÀÌ ¿É¼ÇÀº ¿©·¯¹ø »ç¿ëÇÒ ¼ö ÀÖ´Ù. °¢ archive¿¡ ´ëÇؼ­ ld´Â ÀÚü Æнº¿¡¼­ libarchive.a¸¦ ã´Â´Ù. °øÀ¯ ¶óÀ̺귯¸®¸¦ Áö¿øÇÏ´Â ½Ã½ºÅÛ¿¡¼­´Â .a ¿ÜÀÇ È®ÀåÀÚ¸¦ °¡Áø ¶óÀ̺귯¸®µµ ã´Â´Ù. ±¸Ã¼ÀûÀ¸·Î ELF¿Í SunOS ½Ã½ºÅÛ¿¡¼­ .a È®ÀåÀÚ¸¦ °¡Áø ¶óÀ̺귯¸®¸¦ ã±â Àü¿¡ .so È®ÀåÀÚ¸¦ °¡Áø ¶óÀ̺귯¸®¸¦ ã´Â´Ù. °ü½ÀÀ¸·Î .so È®ÀåÀÚ´Â °øÀ¯ ¶óÀ̺귯¸®¸¦ ³ªÅ¸³½´Ù. ¸µÄ¿´Â ¸í·ÉÇà¿¡ ÁÖ¾îÁø À§Ä¡¿¡¼­ ´Ü Çѹø¸¸ ¶óÀ̺귯¸®¸¦ ã´Â´Ù. ¸í·ÉÇà¿¡¼­ ¶óÀ̺귯¸® Àü¿¡ À§Ä¡ÇÑ ÆÄÀÏ¿¡¼­ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼À» ¶óÀ̺귯¸®°¡ Á¤ÀÇÇϸé, ¸µÄ¿´Â ¶óÀ̺귯¸®·Î ºÎÅÍ Àû´çÇÑ ÆÄÀÏÀ» Æ÷ÇÔÇÑ´Ù. ±×·¯³ª ¸í·ÉÇà¿¡¼­ µÚ¿¡ À§Ä¡ÇÑ ÆÄÀÏÀÇ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼Àº ¶óÀ̺귯¸®¿¡¼­ ´Ù½Ã ãÁö ¾Ê´Â´Ù. See the -( option for a way to force the linker to search archives multiple times. You may list the same archive multiple times on the command line. This type of archive searching is standard for Unix linkers. However, if you are using ld on AIX, note that it is different from the behaviour of the AIX linker.
¸µÄ¿°¡ ¶óÀ̺귯¸®¸¦ ¿©·¯¹ø ã°Ô ¸¸µå·Á¸é -( ¿É¼ÇÀ» Âü°íÇ϶ó. ¶Ç, ¸í·ÉÇà¿¡¼­ °°Àº ¶óÀ̺귯¸®¸¦ ¿©·¯¹ø ¸í½ÃÇصµ µÈ´Ù. ÀÌ·± ¶óÀ̺귯¸® °Ë»öÀº À¯´Ð½º ¸µÄ¿ÀÇ Ç¥ÁØÀÌ´Ù. ±×·¯³ª AIXÀÇ AIX ¸µÄ¿´Â ´Ù¸¥ ÇൿÀ» ÇÑ´Ù´Â °ÍÀ» À¯ÀÇÇ϶ó.
-Lsearchdir
--library-path=searchdir
Add path searchdir to the list of paths that ld will search for archive libraries and ld control scripts. You may use this option any number of times. The directories are searched in the order in which they are specified on the command line. Directories specified on the command line are searched before the default directories. All -L options apply to all -l options, regardless of the order in which the options appear. The default set of paths searched (without being specified with `-L') depends on which emulation mode ld is using, and in some cases also on how it was configured. See section Environment Variables. The paths can also be specified in a link script with the SEARCH_DIR command. Directories specified this way are searched at the point in which the linker script appears in the command line.
ld°¡ ¾ÆÄ«ÀÌºê ¶óÀ̺귯¸®¿Í ½ºÅ©¸³Æ®¸£¸£ ã´Â Æнº ¸ñ·Ï¿¡ searchdirÀ» Ãß°¡ÇÑ´Ù. ÀÌ ¿É¼ÇÀº ¿©·¯¹ø »ç¿ëÇصµ µÈ´Ù. µð·ºÅ丮´Â ¸í·ÉÇà¿¡ ÁÖ¾îÁø ¼ø¼­·Î °Ë»öµÈ´Ù. ¸í·ÉÇà¿¡ ÁÖ¾îÁø µð·ºÅ丮´Â ±âº» µð·ºÅ丮 Àü¿¡ °Ë»öµÈ´Ù. ¸ðµç -L ¿É¼ÇÀº ¿É¼ÇÀÇ ¼ø¼­¿Í °ü°è¾øÀÌ ¸ðµç -l ¿É¼Ç¿¡ Àû¿ëµÈ´Ù. ±âº» Æнº´Â ld°¡ »ç¿ëÇÏ´Â ¿¡¹Ä·¹ÀÌ¼Ç ¸ðµå¿Í ¾î¶»°Ô ±¸¼ºµÇ¾ú³Ä¿¡ µû¶ó ´Ù¸£´Ù. Environment Variables¸¦ Âü°íÇ϶ó. Æнº´Â ¸µÅ© ½ºÅ©¸³Æ®¿¡¼­ SEARCH_DIR ¸í·É¾î·Îµµ ÁöÁ¤µÉ ¼ö ÀÖ´Ù. ÀÌ ¹æ½ÄÀ¸·Î ÁöÁ¤µÈ µð·ºÅ丮´Â ¸í·ÉÇà¿¡¼­ ¸µÄ¿ ½ºÅ©¸³Æ®ÀÇ À§Ä¡¿¡¼­ °Ë»öµÈ´Ù.
-memulation
Emulate the emulation linker. You can list the available emulations with the `--verbose' or `-V' options. If the `-m' option is not used, the emulation is taken from the LDEMULATION environment variable, if that is defined. Otherwise, the default emulation depends upon how the linker was configured.
¸µÄ¿ emulation¸¦ ¿¡¹Ä·¹ÀÌÆ®ÇÑ´Ù. °¡´ÉÇÑ ¸ñ·ÏÀ» `--verbose'³ª `-V' ¿É¼ÇÀ¸·Î ¾Ë ¼ö ÀÖ´Ù. `-m' ¿É¼ÇÀ» »ç¿ëÇÏÁö ¾Ê°í LDEMULATION ȯ°æº¯¼ö°¡ Á¤ÀǵÇÀÖ´Ù¸é À̸¦ »ç¿ëÇÑ´Ù. Á¤ÀǵÇÀÖÁö ¾Ê´Ù¸é ±âº» ¿¡¹Ä·¹À̼ÇÀº ¸µÄ¿°¡ ±¸¼ºµÈ ¹æ½Ä¿¡ µû¶ó ´Ù¸£´Ù.
-M
--print-map
Print a link map to the standard output. A link map provides information about the link, including the following:
¸µÅ©¸ÊÀ» Ç¥ÁØÃâ·ÂÀ¸·Î Ãâ·ÂÇÑ´Ù. ¸µÅ©¸ÊÀº ´ÙÀ½°ú °°Àº ¸µÅ©¿¡ ´ëÇÑ Á¤º¸¸¦ ´ã°í ÀÖ´Ù.
  • ¿ÀºêÁ§Æ® ÆÄÀÏ°ú ½Éº¼ÀÌ ¸Þ¸ð¸®ÀÇ ¾îµð¿¡ ´ëÀÀµÇ´Â°¡
  • °øÅë ½Éº¼Àº ¾î¶»°Ô ÇÒ´çµÇ´Â°¡
  • ¾ÆÄ«ÀÌºê ¸â¹ö¸¦ Æ÷ÇÔÇÏ°Ô ÇÑ ½Éº¼°ú ÇÔ²² ¸µÅ©¿¡ Æ÷ÇÔµÈ ¸ðµç ¾ÆÄ«ÀÌºê ¸â¹ö
-n
--nmagic
Turn off page alignment of sections, and mark the output as NMAGIC if possible.
¼½¼ÇÀÇ ÆäÀÌÁö Á¤·ÄÀ» ²ô°í, °¡´ÉÇϸé, Ãâ·ÂÀ» NMAGICÀ¸·Î Ç¥½ÃÇÑ´Ù. (¿ªÁÖ; NMAGICÀº a.out ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½ÄÀÇ ÀÏÁ¾ÀÌ´Ù.)
-N
--omagic
Set the text and data sections to be readable and writable. Also, do not page-align the data segment. If the output format supports Unix style magic numbers, mark the output as OMAGIC.
text¿Í data ¼½¼ÇÀ» ÀÐ°í¾²±â °¡´ÉÀ¸·Î ¼³Á¤ÇÑ´Ù. ¶Ç, data ¼½¼ÇÀ» ÆäÀÌÁö Á¤·ÄÇÏÁö ¾Ê´Â´Ù. Ãâ·Â Çü½ÄÀÌ À¯´Ð½º Çü½ÄÀÇ ¸ÞÁ÷³Ñ¹ö¸¦ Áö¿øÇϸé Ãâ·ÂÀ» OMAGICÀ¸·Î Ç¥½ÃÇÑ´Ù. (¿ªÁÖ; OMAGICÀº a.out ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½ÄÀÇ ÀÏÁ¾ÀÌ´Ù.)
-o output
--output=output
Use output as the name for the program produced by ld; if this option is not specified, the name `a.out' is used by default. The script command OUTPUT can also specify the output file name.
ldÀÇ °á°ú·Î »ý¼ºµÉ ÇÁ·Î±×·¥ À̸§À» outputÀ¸·Î ÇÑ´Ù. ÀÌ ¿É¼ÇÀÌ ¾ø´Ù¸é ±âº»ÀûÀ¸·Î `a.out'ÀÌ »ç¿ëµÈ´Ù. ½ºÅ©¸³Æ® ¸í·É¾î OUTPUTµµ Ãâ·ÂÆÄÀÏ À̸§À» Á¤ÇÑ´Ù.
-O level
If level is a numeric values greater than zero ld optimizes the output. This might take significantly longer and therefore probably should only be enabled for the final binary.
levelÀÌ 0 º¸´Ù Å« ¼ýÀÚÀ̸é ld´Â Ãâ·ÂÀ» ÃÖÀûÈ­ÇÑ´Ù. ÀÌ °úÁ¤Àº »ó´çÈ÷ ±æ ¼ö Àֱ⠶§¹®¿¡ ¾Æ¸¶µµ ¸¶Áö¸·¿¡ »ç¿ëµÈ´Ù.
-q
--emit-relocs
Leave relocation sections and contents in fully linked exececutables. Post link analysis and optimization tools may need this information in order to perform correct modifications of executables. This results in larger executables.
¿ÏÀüÈ÷ ¸µÅ©µÈ ½ÇÇàÆÄÀÏ¿¡¼­ Àç¹èÄ¡ ¼½¼Ç°ú ³»¿ëÀ» À¯ÁöÇÑ´Ù. ÀÌÈÄ ½ÇÇàÆÄÀÏÀ» Á¤»óÀûÀ¸·Î ¼öÁ¤Çϱâ À§ÇØ ¸µÅ© ºÐ¼®À̳ª ÃÖÀûÈ­ µµ±¸°¡ ÀÌ Á¤º¸¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù. ÀÌ´Â ´õ Å« ½ÇÇàÆÄÀÏÀ» ¸¸µç´Ù.
-r
--relocateable
Generate relocatable output--i.e., generate an output file that can in turn serve as input to ld. This is often called partial linking. As a side effect, in environments that support standard Unix magic numbers, this option also sets the output file's magic number to OMAGIC. If this option is not specified, an absolute file is produced. When linking C++ programs, this option will not resolve references to constructors; to do that, use `-Ur'. This option does the same thing as `-i'.
Àç¹èÄ¡°¡´ÉÇÑ Ãâ·Â, Áï Ãâ·ÂÆÄÀÏÀÌ ´Ù½Ã ldÀÇ ÀÔ·ÂÀ¸·Î »ç¿ëµÉ ¼ö ÀÖ´Â Ãâ·ÂÀ» ¸¸µç´Ù. ÀÌ´Â º¸Åë ºÎºÐ ¸µÅ·À̶ó ºÒ¸°´Ù. ¶ÇÇÑ ½Ã½ºÅÛÀÌ Ç¥ÁØ À¯´Ð½º ¸ÅÁ÷³Ñ¹ö¸¦ Áö¿øÇÑ´Ù¸é ÀÌ ¿É¼ÇÀº Ãâ·ÂÆÄÀÏÀÇ ¸ÅÁ÷³Ñ¹ö¸¦ OMAGICÀ¸·Î ÇÑ´Ù. (¿ªÁÖ; OMAGICÀº a.out ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½ÄÀÇ ÀÏÁ¾ÀÌ´Ù.) ÀÌ ¿É¼ÇÀÌ ¾ø´Ù¸é Àý´ë ÆÄÀÏÀÌ ¸¸µé¾î Áø´Ù. C++ ÇÁ·Î±×·¥À» ¸µÅ©ÇÒ ¶§ ÀÌ ¿É¼ÇÀº »ý¼ºÀÚÀÇ ÂüÁ¶¸¦ ¸®Á¹ºêÇÏÁö ¾Ê´Â´Ù. À̸¦ À§Çؼ­ `-Ur'¸¦ »ç¿ëÇ϶ó. ÀÌ ¿É¼ÇÀº `-i'¿Í µ¿ÀÏÇÏ´Ù.
-R filename
--just-symbols=filename
Read symbol names and their addresses from filename, but do not relocate it or include it in the output. This allows your output file to refer symbolically to absolute locations of memory defined in other programs. You may use this option more than once. For compatibility with other ELF linkers, if the -R option is followed by a directory name, rather than a file name, it is treated as the -rpath option.
filename¿¡¼­ ½Éº¼ À̸§°ú ÁÖ¼Ò¸¦ ÀÐÁö¸¸ Àç¹èÄ¡³ª Ãâ·Â¿¡ Æ÷ÇÔÇÏÁö´Â ¾Ê´Â´Ù. ÀÌ ¿É¼ÇÀ¸·Î Ãâ·ÂÆÄÀÏÀÌ ´Ù¸¥ ÇÁ·Î±×·¥ÀÇ ¸Þ¸ð¸® »óÀÇ Á¤ÀÇµÈ À§Ä¡¸¦ ½Éº¼·Î ÂüÁ¶ÇÒ ¼ö ÀÖ´Ù. ÀÌ ¿É¼ÇÀº ¿©·¯¹ø »ç¿ëÇصµ µÈ´Ù. ´Ù¸¥ ELF ¸µÄ¿¿Í ȣȯÀ» À§ÇØ -R ¿É¼Ç ´ÙÀ½¿¡ ÆÄÀÏÀ̸§ ´ë½Å µð·ºÅ丮 À̸§ÀÌ ³ª¿Ã °æ¿ì -rpath ¿É¼ÇÀ¸·Î Ãë±ÞµÈ´Ù.
-s
--strip-all
Omit all symbol information from the output file.
Ãâ·ÂÆÄÀÏ¿¡¼­ ¸ðµç ½Éº¼ Á¤º¸¸¦ »ý·«ÇÑ´Ù.
-S
--strip-debug
Omit debugger symbol information (but not all symbols) from the output file.
Ãâ·ÂÆÄÀÏ¿¡¼­ (¸ðµç ½Éº¼ÀÌ ¾Æ´Ï¶ó) µð¹ö°Å ½Éº¼ Á¤º¸¸¸À» »ý·«ÇÑ´Ù.
-t
--trace
Print the names of the input files as ld processes them.
ó¸®ÇÏ´Â ÀÔ·ÂÆÄÀÏ À̸§À» Ãâ·ÂÇÑ´Ù.
-T scriptfile
--script=scriptfile
Use scriptfile as the linker script. This script replaces ld's default linker script (rather than adding to it), so commandfile must specify everything necessary to describe the output file. You must use this option if you want to use a command which can only appear once in a linker script, such as the SECTIONS or MEMORY command. See section Linker Scripts. If scriptfile does not exist in the current directory, ld looks for it in the directories specified by any preceding `-L' options. Multiple `-T' options accumulate.
¸µÄ¿ ½ºÅ©¸³Æ®·Î scriptfileÀ» »ç¿ëÇÑ´Ù. ÀÌ ¿É¼ÇÀº ±âº» ¸µÄ¿ ½ºÅ©¸³Æ®¸¦ (º¸¿ÏÇÏ´Â °ÍÀÌ ¾Æ´Ï¶ó) ´ëüÇϱ⠶§¹®¿¡, commandfileÀº Ãâ·ÂÆÄÀÏÀ» ±â¼úÇϴµ¥ ÇÊ¿äÇÑ ¸ðµç °ÍÀ» ´ã°í ÀÖ¾î¾ß ÇÑ´Ù. SECTIONS³ª MEMORY ¸í·É¾î¿Í °°ÀÌ ¸µÄ¿ ½ºÅ©¸³Æ®¿¡¼­ ´Ü Çѹø¸¸ »ç¿ëµÉ ¼ö ÀÖ´Â ¸í·É¾î¸¦ »ç¿ëÇØ¾ß ÇÑ´Ù¸é ÀÌ ¿É¼ÇÀÌ ÇÊ¿äÇÏ´Ù. Linker Scripts¸¦ ÂüÁ¶Ç϶ó. scriptfileÀÌ ÇöÀç µð·ºÅ丮¿¡ ¾ø´Ù¸é ±× Àü `-L' ¿É¼ÇÀ¸·Î ÁöÁ¤µÈ µð·ºÅ丮¿¡¼­ ã´Â´Ù. ¿©·¯ `-T' ¿É¼ÇÀÇ ³»¿ëÀº ¼­·Î ÃàÀûµÈ´Ù.
-u symbol
--undefined=symbol
Force symbol to be entered in the output file as an undefined symbol. Doing this may, for example, trigger linking of additional modules from standard libraries. `-u' may be repeated with different option arguments to enter additional undefined symbols. This option is equivalent to the EXTERN linker script command.
Ãâ·ÂÆÄÀÏ¿¡ symbolÀÌ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼·Î Æ÷ÇÔµÇ°Ô ÇÑ´Ù. ÀÌ·¸°Ô ÇÏ¿© ¿¹¸¦ µé¾î Ç¥ÁØ ¶óÀ̺귯¸®¿¡¼­ Ãß°¡·Î ¸ðµâÀ» ¸µÅ©ÇÏ°Ô ÇÒ ¼ö ÀÖ´Ù. `-u' ¿É¼ÇÀº ¿©·¯ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼À» Æ÷ÇÔÇϱâ À§Çؼ­ ´Ù¸¥ ¾Æ±Ô¸ÕÆ®·Î ¿©·¯¹ø »ç¿ëÇÒ ¼ö ÀÖ´Ù. ¸µÄ¿ ½ºÅ©¸³Æ®ÀÇ EXTERN ¸í·É¾îµµ °°Àº ±â´ÉÀ» ÇÑ´Ù.
-Ur
For anything other than C++ programs, this option is equivalent to `-r': it generates relocatable output--i.e., an output file that can in turn serve as input to ld. When linking C++ programs, `-Ur' does resolve references to constructors, unlike `-r'. It does not work to use `-Ur' on files that were themselves linked with `-Ur'; once the constructor table has been built, it cannot be added to. Use `-Ur' only for the last partial link, and `-r' for the others.
C++ ÇÁ·Î±×·¥ÀÌ ¾Æ´Ï¸é ÀÌ ¿É¼ÇÀº Àç¹èÄ¡°¡´ÉÇÑ (Ãâ·ÂÆÄÀÏÀ» ´Ù½Ã ÀÔ·ÂÀ¸·Î »ç¿ëÇÒ ¼ö ÀÖ´Â) Ãâ·ÂÀ» »ý¼ºÇÏ´Â `-r' ¿É¼Ç°ú µ¿ÀÏÇÏ´Ù. C++ ÇÁ·Î±×·¥À» ¸µÅ©ÇÒ ¶§, `-Ur' ¿É¼ÇÀº `-r'¿Í ´Ù¸£°Ô »ý¼ºÀÚ·Î ÂüÁ¶¸¦ ¸®Á¹ºêÇÑ´Ù. ÀÌ¹Ì `-Ur'·Î ¸µÅ©µÈ ÆÄÀÏ¿¡ ÀÌ ¿É¼ÇÀº ¾Æ¹«Àϵµ ÇÏÁö ¾Ê´Â´Ù. Çѹø »ý¼ºÀÚÇ¥°¡ ¸¸µé¾îÁö¸é, Ãß°¡µÉ ¼ö ¾ø´Ù. ±×·¡¼­ ¸¶Áö¸· ºÎºÐ ¸µÅ©¿¡¸¸ `-Ur'¸¦ »ç¿ëÇÏ°í, ³ª¸ÓÁö´Â `-r'¸¦ »ç¿ëÇÑ´Ù.
--unique[=SECTION]
Creates a separate output section for every input section matching SECTION, or if the optional wildcard SECTION argument is missing, for every orphan input section. An orphan section is one not specifically mentioned in a linker script. You may use this option multiple times on the command line; It prevents the normal merging of input sections with the same name, overriding output section assignments in a linker script.
SECTION¿¡ ´ëÀÀÇÏ´Â ¸ðµç ÀÔ·Â ¼½¼Ç¿¡ ´ëÇؼ­ µ¶¸³µÈ Ãâ·Â ¼½¼ÇÀ» »ý¼ºÇÑ´Ù. SECTION ¾Æ±Ô¸ÕÆ®°¡ ¾ø´Ù¸é ¸ðµç °í¾Æ ÀÔ·Â ¼½¼Ç¿¡ ´ëÇؼ­ µ¶¸³µÈ Ãâ·Â ¼½¼ÇÀ» ¸¸µç´Ù. °í¾Æ ¼½¼ÇÀº ¸µÄ¿ ½ºÅ©¸³Æ®¿¡ ¸í½ÃµÇÁö ¾ÊÀº ¼½¼ÇÀ» ¸»ÇÑ´Ù. ÀÌ ¿É¼ÇÀº ¿©·¯¹ø »ç¿ëÇÒ ¼ö ÀÖ´Ù. ÀÌ ¿É¼ÇÀº ¸µÄ¿ ½ºÅ©¸³Æ®ÀÇ Ãâ·Â ¼½¼Ç ÇÒ´çÀ» ¹«½ÃÇÏ°í, ÀÔ·Â ¼½¼ÇÀ» °°Àº À̸§À¸·Î °áÇÕÇÏ´Â °ÍÀ» ¸·´Â´Ù.
-v
--version
-V
Display the version number for ld. The -V option also lists the supported emulations.
ldÀÇ ¹öÀüÀ» Ãâ·ÂÇÑ´Ù. -V ¿É¼ÇÀº Áö¿øµÇ´Â ¿¡¹Ä·¹À̼ǵµ °°ÀÌ Ãâ·ÂÇÑ´Ù.
-x
--discard-all
Delete all local symbols.
¸ðµç Áö¿ª ½Éº¼À» »èÁ¦ÇÑ´Ù.
-X
--discard-locals
Delete all temporary local symbols. For most targets, this is all local symbols whose names begin with `L'.
¸ðµç Àӽà Áö¿ª ½Éº¼À» »èÁ¦ÇÑ´Ù. ¸¹Àº °æ¿ì À̸§ÀÌ `L'·Î ½ÃÀÛÇÏ´Â Áö¿ª ½Éº¼ÀÌ´Ù.
-y symbol
--trace-symbol=symbol
Print the name of each linked file in which symbol appears. This option may be given any number of times. On many systems it is necessary to prepend an underscore. This option is useful when you have an undefined symbol in your link but don't know where the reference is coming from.
¸µÅ©ÇÒ ÆÄÀÏ¿¡¼­ symbolÀÌ ¹ß°ßµÇ¸é ÆÄÀÏÀ̸§À» Ãâ·ÂÇÑ´Ù. ÀÌ ¿É¼ÇÀº ¿©·¯¹ø »ç¿ëÇÒ ¼ö ÀÖ´Ù. ¸¹Àº ½Ã½ºÅÛ¿¡¼­ `_'¸¦ ¾Õ¿¡ ºÙ¿©¾ßÇÑ´Ù. ÀÌ ¿É¼ÇÀº ¾îµð¼­ ÂüÁ¶°¡ µÇ´ÂÁö ¸ð¸£´Â Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼À» È®ÀÎÇÒ ¶§ À¯¿ëÇÏ´Ù.
-Y path
Add path to the default library search path. This option exists for Solaris compatibility.
path¸¦ ±âº» ¶óÀ̺귯¸® °Ë»ö Æнº¿¡ Ãß°¡ÇÑ´Ù. ÀÌ ¿É¼ÇÀº Solaris¿Í ȣȯÀ» À§ÇØ ÀÖ´Ù.
-z keyword
The recognized keywords are initfirst, interpose, loadfltr, nodefaultlib, nodelete, nodlopen, nodump, now and origin. The other keywords are ignored for Solaris compatibility. initfirst marks the object to be initialized first at runtime before any other objects. interpose marks the object that its symbol table interposes before all symbols but the primary executable. loadfltr marks the object that its filtees be processed immediately at runtime. nodefaultlib marks the object that the search for dependencies of this object will ignore any default library search paths. nodelete marks the object shouldn't be unloaded at runtime. nodlopen marks the object not available to dlopen. nodump marks the object can not be dumped by dldump. now marks the object with the non-lazy runtime binding. origin marks the object may contain $ORIGIN. defs disallows undefined symbols.
°¡´ÉÇÑ keyword °ªÀº initfirst, interpose, loadfltr, nodefaultlib, nodelete, nodlopen, nodump, now, origin ÀÌ´Ù. ´Ù¸¥ Å°¿öµå´Â Solaris¿Í ȣȯÀ» À§ÇÑ °ÍÀ¸·Î ¹«½ÃµÈ´Ù. initfirst´Â °´Ã¼°¡ ½ÇÇà Áß ´Ù¸¥ °´Ã¼ º¸´Ù ¸ÕÀú ÃʱâÈ­µÇµµ·Ï Ç¥½ÃÇÑ´Ù. interpose´Â °´Ã¼ÀÇ ½Éº¼Ç¥¸¦ ÁÖ ½ÇÇàÆÄÀÏÀ» Á¦¿ÜÇÑ ¸ðµç ½Éº¼ Àü¿¡ Æ÷ÇÔ½ÃŲ´Ù. loadfltr´Â °´Ã¼¿¡ ½ÇÇà Áß ÀÌ °´Ã¼·Î ÇÊÅÍÇÏ´Â °´Ã¼°¡ Áï½Ã ó¸®µÇ°Ô Ç¥½ÃÇÑ´Ù. nodefaultlib´Â °´Ã¼ÀÇ ÀÇÁ¸À» °Ë»öÇÒ ¶§ ±âº» ¶óÀ̺귯¸® °Ë»ö Æнº¸¦ ¹«½ÃÇϵµ·Ï Ç¥½ÃÇÑ´Ù. nodelete´Â °´Ã¼°¡ ½ÇÇà Áß¿¡ ¾ð·ÎµåµÇÁö ¾Ê°Ô Ç¥½ÃÇÑ´Ù. nodlopen´Â °´Ã¼°¡ dlopen·Î »ç¿ëÇÒ ¼ö ¾ø°Ô Ç¥½ÃÇÑ´Ù. nodump´Â °´Ã¼°¡ dldump·Î ´ýÇÁµÉ ¼ö ¾ø°Ô Ç¥½ÃÇÑ´Ù. now´Â °´Ã¼¸¦ ½ÇÇà Áß ·¹ÀÌÁö¹ÙÀεù(lazy binding) ÇÏÁö ¾Êµµ·Ï Ç¥½ÃÇÑ´Ù. originÀº °´Ã¼°¡ $ORGINÀ» Æ÷ÇÔÇÒ ¼ö ÀÖ´Ù°í Ç¥½ÃÇÑ´Ù. defs´Â Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼À» Çã¿ëÇÏÁö ¾Ê´Â´Ù.
-( archives -)
--start-group archives --end-group
The archives should be a list of archive files. They may be either explicit file names, or `-l' options. The specified archives are searched repeatedly until no new undefined references are created. Normally, an archive is searched only once in the order that it is specified on the command line. If a symbol in that archive is needed to resolve an undefined symbol referred to by an object in an archive that appears later on the command line, the linker would not be able to resolve that reference. By grouping the archives, they all be searched repeatedly until all possible references are resolved. Using this option has a significant performance cost. It is best to use it only when there are unavoidable circular references between two or more archives.
archives´Â ¾ÆÄ«À̺ê ÆÄÀÏÀÇ ¸ñ·ÏÀÌ´Ù. ÀÌ´Â Á÷Á¢ ÆÄÀÏÀ̸§À̳ª `-l' ¿É¼ÇÀÌ´Ù. ÁÖ¾îÁø ¾ÆÄ«À̺êµéÀº ¾î¶² »õ·Î¿î Á¤ÀǵÇÁö ¾ÊÀº ÂüÁ¶°¡ ¸¸µé¾îÁö±â Àü±îÁö ¹Ýº¹Çؼ­ °Ë»öµÈ´Ù. º¸Åë ¾ÆÄ«À̺ê´Â ¸í·ÉÇà¿¡ ÁÖ¾îÁø ¼ø¼­·Î ´Ü Çѹø¸¸ °Ë»öµÈ´Ù. ¸í·ÉÇà¿¡¼­ µÚ¿¡ ³ª¿À´Â ¾ÆÄ«À̺êÀÇ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼ÀÌ ¾ÕÀÇ ¾ÆÄ«À̺êÀÇ ½Éº¼À» ÂüÁ¶ÇÑ´Ù¸é, ¸µÄ¿´Â ÂüÁ¶¸¦ ¸®Á¹ºêÇÏÁö ¸øÇÑ´Ù. ÀÌ ¿É¼ÇÀ¸·Î ¼­·Î ¹­¿©Áø ¾ÆÄ«À̺êµéÀº °¡´ÉÇÑ ¸ðµç ÂüÁ¶°¡ ¸®Á¹ºêµÉ ¶§±îÁö ¹Ýº¹Çؼ­ °Ë»öµÈ´Ù. ÀÌ ¿É¼ÇÀº ¸Å¿ì ´À¸®´Ù. µÑ ÀÌ»óÀÇ ¾ÆÄ«ÀÌºê »çÀÌ¿¡ ÇÇÇÒ ¼ö ¾ø´Â ¼øȯÂüÁ¶°¡ ÀÖÀ» ¶§ À¯¿ëÇÏ´Ù.
-assert keyword
This option is ignored for SunOS compatibility.
ÀÌ ¿É¼ÇÀº SunOS¿Í ȣȯÀ» À§ÇØ Á¦°øµÇ¸ç ¹«½ÃµÈ´Ù.
-Bdynamic
-dy
-call_shared
Link against dynamic libraries. This is only meaningful on platforms for which shared libraries are supported. This option is normally the default on such platforms. The different variants of this option are for compatibility with various systems. You may use this option multiple times on the command line: it affects library searching for -l options which follow it.
µ¿Àû ¶óÀ̺귯¸®·Î ¸µÅ©ÇÑ´Ù. ÀÌ ¿É¼ÇÀº °øÀ¯ ¶óÀ̺귯¸®°¡ Áö¿øµÇ´Â Ç÷¡Æû¿¡¼­¸¸ Àǹ̰¡ ÀÖ´Ù. ±×·± Ç÷¡Æû¿¡¼­ º¸Åë ÀÌ ¿É¼ÇÀº ±âº»°ªÀÌ´Ù. ÀÌ ¿É¼ÇÀÇ ´Ù¸¥ Ç¥ÇöÀº ¿©·¯ ½Ã½ºÅÛ°ú ȣȯÀ» À§ÇØ ÀÖ´Ù. ÀÌ ¿É¼ÇÀº ¸í·ÉÇà¿¡¼­ ¿©·¯¹ø »ç¿ëÇÒ ¼ö ÀÖ´Ù. ÀÌ ¿É¼Ç ´ÙÀ½¿¡ ¿À´Â -l ¿É¼ÇÀÇ ¶óÀ̺귯¸® °Ë»ö¿¡ ¿µÇâÀ» ÁØ´Ù.
-Bgroup
Set the DF_1_GROUP flag in the DT_FLAGS_1 entry in the dynamic section. This causes the runtime linker to handle lookups in this object and its dependencies to be performed only inside the group. --no-undefined is implied. This option is only meaningful on ELF platforms which support shared libraries.
µ¿Àû ¼½¼ÇÀÇ DT_FLAGS_1 Ç׸ñ¿¡ DF_1_GROUP Ç÷¡±×¸¦ ¼³Á¤ÇÑ´Ù. ±×·¡¼­ ½ÇÇà Áß ¸µÄ¿°¡ ÀÌ °´Ã¼¿Í ÀÇÁ¸ÇÏ´Â °´Ã¼¿¡¼­ °Ë»öÀ» ±×·ì ¾È¿¡¼­¸¸ ¼öÇàµÇµµ·Ï ÇÑ´Ù. --no-undefined ¿É¼ÇÀº °¡Á¤µÈ´Ù. ÀÌ ¿É¼ÇÀº °øÀ¯ ¶óÀ̺귯¸®¸¦ Áö¿øÇÏ´Â ELF Ç÷¡Æû¿¡¼­¸¸ Àǹ̰¡ ÀÖ´Ù.
-Bstatic
-dn
-non_shared
-static
Do not link against shared libraries. This is only meaningful on platforms for which shared libraries are supported. The different variants of this option are for compatibility with various systems. You may use this option multiple times on the command line: it affects library searching for -l options which follow it.
µ¿Àû ¶óÀ̺귯¸®·Î ¸µÅ©ÇÏÁö ¾Ê´Â´Ù. ÀÌ ¿É¼ÇÀº °øÀ¯ ¶óÀ̺귯¸®°¡ Áö¿øµÇ´Â Ç÷¡Æû¿¡¼­¸¸ Àǹ̰¡ ÀÖ´Ù. ÀÌ ¿É¼ÇÀÇ ´Ù¸¥ Ç¥ÇöÀº ¿©·¯ ½Ã½ºÅÛ°ú ȣȯÀ» À§ÇØ ÀÖ´Ù. ÀÌ ¿É¼ÇÀº ¸í·ÉÇà¿¡¼­ ¿©·¯¹ø »ç¿ëÇÒ ¼ö ÀÖ´Ù. ÀÌ ¿É¼Ç ´ÙÀ½¿¡ ¿À´Â -l ¿É¼ÇÀÇ ¶óÀ̺귯¸® °Ë»ö¿¡ ¿µÇâÀ» ÁØ´Ù.
-Bsymbolic
When creating a shared library, bind references to global symbols to the definition within the shared library, if any. Normally, it is possible for a program linked against a shared library to override the definition within the shared library. This option is only meaningful on ELF platforms which support shared libraries.
°øÀ¯ ¶óÀ̺귯¸®¸¦ ¸¸µé ¶§ Àü¿ª ½Éº¼ÀÇ ÂüÁ¶¸¦ °¡´ÉÇÏ¸é °øÀ¯ ¶óÀ̺귯¸® ¾ÈÀÇ Á¤ÀÇ¿¡ ¹ÙÀεåÇÑ´Ù. º¸Åë °øÀ¯ ¶óÀ̺귯¸®¿Í ¸µÅ©µÇ´Â ÇÁ·Î±×·¥Àº °øÀ¯ ¶óÀ̺귯¸®ÀÇ Á¤ÀǸ¦ ´ëüÇÏ´Â °ÍÀÌ °¡´ÉÇÏ´Ù. ÀÌ ¿É¼ÇÀº °øÀ¯ ¶óÀ̺귯¸®¸¦ Áö¿øÇÏ´Â ELF Ç÷¡Æû¿¡¼­¸¸ Àǹ̰¡ ÀÖ´Ù.
--check-sections
--no-check-sections
Asks the linker not to check section addresses after they have been assigned to see if there any overlaps. Normally the linker will perform this check, and if it finds any overlaps it will produce suitable error messages. The linker does know about, and does make allowances for sections in overlays. The default behaviour can be restored by using the command line switch `--check-sections'.
¸µÄ¿°¡ ¼½¼Ç ÁÖ¼Ò¸¦ ÇÒ´çÇÑ ÈÄ ¾î¶² °ãħÀÌ ÀÖ´ÂÁö °Ë»çÇÏÁö ¾Ê°Ô ÇÑ´Ù. º¸Åë ¸µÄ¿´Â ÀÌ °Ë»ç¸¦ ÇÏ°í °ãħÀÌ ¹ß°ßµÇ¸é Àû´çÇÑ ¿À·ù¹®À» Ãâ·ÂÇÑ´Ù. ±âº»°ªÀ¸·Î `--check-sections'À» »ç¿ëÇÏ¿© µÇµ¹¸± ¼ö ÀÖ´Ù.
--cref
Output a cross reference table. If a linker map file is being generated, the cross reference table is printed to the map file. Otherwise, it is printed on the standard output. The format of the table is intentionally simple, so that it may be easily processed by a script if necessary. The symbols are printed out, sorted by name. For each symbol, a list of file names is given. If the symbol is defined, the first file listed is the location of the definition. The remaining files contain references to the symbol.
±³Â÷ÂüÁ¶Ç¥¸¦ Ãâ·ÂÇÑ´Ù. ¸µÄ¿¸ÊÀÌ »ý¼ºµÈ´Ù¸é ±³Â÷ÂüÁ¶Ç¥´Â ¸ÊÆÄÀÏ¿¡ Ãâ·ÂµÈ´Ù. ±×·¸Áö ¾Ê´Ù¸é Ç¥ÁØÃâ·Â¿¡ Ãâ·ÂµÈ´Ù. Ç¥ÀÇ Çü½ÄÀº ÀǵµÀûÀ¸·Î °£´ÜÇÏ¿© ÇÊ¿äÇÏ´Ù¸é ½ºÅ©¸³Æ®·Î ½±°Ô ó¸®ÇÒ ¼ö ÀÖ´Ù. ½Éº¼Àº À̸§À¸·Î Á¤·ÄÇÏ¿© Ãâ·ÂµÈ´Ù. °¢ ½Éº¼¿¡ ´ëÇؼ­ ÆÄÀÏÀ̸§ ¸ñ·Ïµµ ÁÖ¾îÁø´Ù. ½Éº¼ÀÌ Á¤ÀǵǾú´Ù¸é ¸ñ·ÏÀÇ Ã¹ ÆÄÀÏÀÌ Á¤ÀÇÇÑ °÷ÀÌ´Ù. ³ª¸ÓÁö ÆÄÀÏÀº ½Éº¼À» ÂüÁ¶ÇÑ ÆÄÀϵéÀÌ´Ù.
--defsym symbol=expression
Create a global symbol in the output file, containing the absolute address given by expression. You may use this option as many times as necessary to define multiple symbols in the command line. A limited form of arithmetic is supported for the expression in this context: you may give a hexadecimal constant or the name of an existing symbol, or use + and - to add or subtract hexadecimal constants or symbols. If you need more elaborate expressions, consider using the linker command language from a script (see section Assigning Values to Symbols). Note: there should be no white space between symbol, the equals sign ("="), and expression.
Àý´ë ÁÖ¼Ò expressionÀ» °¡Áö°í Ãâ·ÂÆÄÀÏ¿¡ Àü¿ª ½Éº¼À» ¸¸µç´Ù. ÀÌ ¿É¼ÇÀ» ¿©·¯ ½Éº¼À» Á¤ÀÇÇϱâ À§Çؼ­ ¿©·¯¹ø »ç¿ëÇصµ µÈ´Ù. expression¿¡ ´ÙÀ½ÀÇ Á¦ÇÑµÈ ¿¬»êÀÌ °¡´ÉÇÏ´Ù. 16 Áø¼ö »ó¼ö³ª ÀÌ¹Ì Á¸ÀçÇÏ´Â ½Éº¼ À̸§°ú À̵éÀ» ´õÇϰųª »©±â À§Çؼ­ +, -¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù. ´õ º¹ÀâÇÑ ¿¬»êÀÌ ÇÊ¿äÇÏ¸é ¸µÄ¿ ¸í·É ¾ð¾î ½ºÅ©¸³Æ®¸¦ (Assigning Values to Symbols Âü°í) »ç¿ëÇضó. ÁÖÀÇ! symbol°ú µîÈ£ ("="), expression »çÀÌ¿¡ °ø¹éÀÌ ÀÖÀ¸¸é ¾ÈµÈ´Ù.
--demangle[=style]
--no-demangle
These options control whether to demangle symbol names in error messages and other output. When the linker is told to demangle, it tries to present symbol names in a readable fashion: it strips leading underscores if they are used by the object file format, and converts C++ mangled symbol names into user readable names. Different compilers have different mangling styles. The optional demangling style argument can be used to choose an appropriate demangling style for your compiler. The linker will demangle by default unless the environment variable `COLLECT_NO_DEMANGLE' is set. These options may be used to override the default.
ÀÌ ¿É¼ÇÀº ¿À·ù¹®À̳ª Ãâ·Â¿¡¼­ ½Éº¼À̸§À» µð¸Í±Û¸µÇÒÁö¸¦ °áÁ¤ÇÑ´Ù. ¸µÄ¿°¡ µð¸Í±Û¸µÇÑ´Ù¸é ½Éº¼À̸§À» Àб⠽¬¿î Çü½ÄÀ¸·Î Ãâ·ÂÇÏ·Á°í ÇÑ´Ù. ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½ÄÀÌ ¾Õ¿¡ `_'À» »ç¿ëÇÑ´Ù¸é Á¦°ÅÇÏ°í, C++ ¸Í±Û¸µµÈ ½Éº¼ À̸§À» »ç¶÷ÀÌ ÀÐÀ» ¼ö ÀÖ´Â À̸§À¸·Î º¯È¯ÇÑ´Ù. ÄÄÆÄÀÏ·¯ ¸¶´Ù ´Ù¸¥ ¸Í±Û¸µ Çü½ÄÀ» °¡Áö°í ÀÖ´Ù. Ãß°¡·Î ¸Í±Û¸µ Çü½Ä ¾Æ±Ô¸ÕÆ®·Î ÄÄÆÄÀÏ·¯¿¡ Àû´çÇÑ Çü½ÄÀ» ¼±ÅÃÇÒ ¼ö ÀÖ´Ù. ¸µÄ¿´Â `COLLECT_NO_DEMANGLE' ȯ°æº¯¼ö°¡ ¾ø´Ù¸é ±âº»ÀûÀ¸·Î µð¸Í±Û¸µÇÑ´Ù. ÀÌ ¿É¼ÇÀº ±âº»°ªÀ» ´ëüÇϱâÀ§ÇØ »ç¿ëµÈ´Ù.
--dynamic-linker file
Set the name of the dynamic linker. This is only meaningful when generating dynamically linked ELF executables. The default dynamic linker is normally correct; don't use this unless you know what you are doing.
µ¿Àû ¸µÄ¿ À̸§À» ¼³Á¤ÇÑ´Ù. ÀÌ ¿É¼ÇÀº µ¿Àû ¸µÅ©µÈ ELF ½ÇÇàÆÄÀÏÀ» »ý¼ºÇÒ ¶§¸¸ Àǹ̰¡ ÀÖ´Ù. º¸Åë ±âº» µ¿Àû ¸µÄ¿¸¦ (¿ªÁÖ; Linux¿¡¼­´Â .interp ¼½¼ÇÀÇ ³»¿ëÀÎ /lib/ld.so.2) »ç¿ëÇÏ´Â °ÍÀÌ Á¤»óÀÌ´Ù. ¹«¾ùÀ» ÇÏ´ÂÁö ¸ð¸¥´Ù¸é »ç¿ëÇÏÁö ¸¶¶ó.
--embedded-relocs
This option is only meaningful when linking MIPS embedded PIC code, generated by the -membedded-pic option to the GNU compiler and assembler. It causes the linker to create a table which may be used at runtime to relocate any data which was statically initialized to pointer values. See the code in testsuite/ld-empic for details.
ÀÌ ¿É¼ÇÀº GNU ÄÄÆÄÀÏ·¯¿Í ¾î¼Àºí·¯ÀÇ -membedded-pic ¿É¼ÇÀ¸·Î ¸¸µé¾îÁø MIP ÀÓº£µðµå PIC Äڵ带 ¸µÅ©ÇÒ ¶§¸¸ Àǹ̰¡ ÀÖ´Ù. ÀÌ ¿É¼ÇÀº ¸µÄ¿°¡ Æ÷ÀÎÅÍ°ª¿¡ Á¤ÀûÀ¸·Î ÃʱâÈ­ÇÑ ÀڷḦ Àç¹èÄ¡Çϱâ À§Çؼ­ ½ÇÇà Áß¿¡ »ç¿ëµÉ Ç¥¸¦ ¸¸µé°Ô ÇÑ´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº testsuite/ld-empic ¿¡ ÀÖ´Â Äڵ带 ÂüÁ¶Ç϶ó.
--force-exe-suffix
Make sure that an output file has a .exe suffix. If a successfully built fully linked output file does not have a .exe or .dll suffix, this option forces the linker to copy the output file to one of the same name with a .exe suffix. This option is useful when using unmodified Unix makefiles on a Microsoft Windows host, since some versions of Windows won't run an image unless it ends in a .exe suffix.
Ãâ·ÂÆÄÀÏÀÌ .exe È®ÀåÀÚ¸¦ °¡Áö°Ô ÇÑ´Ù. ¼º°øÀûÀ¸·Î ¿ÏÀüÈ÷ ¸µÅ©µÈ °á°úÆÄÀÏÀÌ .exe³ª .dll È®ÀåÀÚ¸¦ °¡ÁöÁö ¾Ê´Â´Ù¸é, ÀÌ ¿É¼ÇÀº °á°úÆÄÀÏÀ» °°Àº À̸§¿¡ .exe È®ÀåÀÚ¸¦ °¡Áø ÆÄÀÏ·Î º¹»çÇÑ´Ù. ¸î¸î Winodws°¡ .exe È®ÀåÀÚ°¡ ¾ø´Ù¸é ½ÇÇàÆÄÀÏÀ» ½ÇÇàÇÏÁö ¸øÇÏÁö ¶§¹®¿¡, ÀÌ ¿É¼ÇÀº Microsoft Windows¿¡¼­ À¯´Ð½º makefileÀ» ¼öÁ¤ÇÏÁö ¾Ê°í »ç¿ëÇÒ ¶§ À¯¿ëÇÏ´Ù.
--no-gc-sections
--gc-sections
Enable garbage collection of unused input sections. It is ignored on targets that do not support this option. This option is not compatible with `-r', nor should it be used with dynamic linking. The default behaviour (of not performing this garbage collection) can be restored by specifying `--no-gc-sections' on the command line.
»ç¿ëµÇÁö ¾ÊÀº ÀÔ·Â ¼½¼ÇÀÇ °¡ºñÁöÄ÷¢¼ÇÀ» °¡´ÉÇÏ°Ô ÇÑ´Ù. ÀÌ ¿É¼ÇÀ» Áö¿øÇÏÁö ¾Ê´Â ÄÄÇ»ÅÍ¿¡¼­´Â ¹«½ÃµÈ´Ù. ÀÌ ¿É¼ÇÀº `-r'°ú °°ÀÌ »ç¿ëÇÒ ¼ö ¾ø°í µ¿Àû ¸µÅ©½Ã¿¡µµ »ç¿ëÇÒ ¼ö ¾ø´Ù. `--no-gc-sections' ¿É¼ÇÀ¸·Î (°¡ºñÁöÄ÷¢¼ÇÀ» ÇÏÁö ¾Ê´Â) ±âº» ÇൿÀ¸·Î µ¹¾Æ¿Ã ¼ö ÀÖ´Ù.
--help
Print a summary of the command-line options on the standard output and exit.
Ç¥ÁØÃâ·Â¿¡ ¸í·ÉÇà ¿É¼ÇÀ» °£´ÜÈ÷ Ãâ·ÂÇÏ°í Á¾·áÇÑ´Ù.
--target-help
Print a summary of all target specific options on the standard output and exit.
Ç¥ÁØÃâ·Â¿¡ Ç÷¡Æû ƯÀ¯ÀÇ ¿É¼ÇµéÀ» Ãâ·ÂÇÏ°í Á¾·áÇÑ´Ù.
-Map mapfile
Print a link map to the file mapfile. See the description of the `-M' option, above.
¸µÅ©¸ÊÀ» ÆÄÀÏ mapfile¿¡ Ãâ·ÂÇÑ´Ù. À§¿¡¼­ `-M' ¿É¼ÇÀ» ÂüÁ¶Ç϶ó.
--no-keep-memory
ld normally optimizes for speed over memory usage by caching the symbol tables of input files in memory. This option tells ld to instead optimize for memory usage, by rereading the symbol tables as necessary. This may be required if ld runs out of memory space while linking a large executable.
ld´Â ±âº»ÀûÀ¸·Î ¸Þ¸ð¸®¿¡ ÀÔ·ÂÆÄÀÏÀÇ ½Éº¼Ç¥¸¦ ÀúÀåÇÏ¿© (¸Þ¸ð¸® º¸´Ù´Â) ¼Óµµ¿¡ ÃÖÀûÈ­ÇÏ¿© ½ÇÇàµÈ´Ù. ´ë½Å ÀÌ ¿É¼ÇÀº ÇÊ¿äÇÒ ¶§¸¶´Ù ½Éº¼Ç¥¸¦ Àоîµé¿©¼­ ¸Þ¸ð¸® »ç¿ëÀ» ÃÖ¼ÒÈ­ÇÏ°Ô ÇÑ´Ù. ÀÌ ¿É¼ÇÀº Å« ½ÇÇàÆÄÀÏÀ» ¸µÅ©ÇÒ ¶§ ¸Þ¸ð¸® ºÎÁ·ÇØÁø´Ù¸é ÇÊ¿äÇÏ´Ù.
--no-undefined
-z defs
Normally when creating a non-symbolic shared library, undefined symbols are allowed and left to be resolved by the runtime loader. These options disallow such undefined symbols.
º¸Åë °øÀ¯ ¶óÀ̺귯¸®¸¦ ¸¸µé ¶§ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼ÀÌ Çã¿ëµÇ°í ½ÇÇà Áß ·Î´õ°¡ ¸®Á¹ºêÇϵµ·Ï ³²°ÜÁø´Ù. ÀÌ ¿É¼ÇÀº ÀÌ·± Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼À» Çã¿ëÇÏÁö ¾Ê´Â´Ù.
--allow-shlib-undefined
Allow undefined symbols in shared objects even when --no-undefined is set. The net result will be that undefined symbols in regular objects will still trigger an error, but undefined symbols in shared objects will be ignored. The implementation of no_undefined makes the assumption that the runtime linker will choke on undefined symbols. However there is at least one system (BeOS) where undefined symbols in shared libraries is normal since the kernel patches them at load time to select which function is most appropriate for the current architecture. I.E. dynamically select an appropriate memset function. Apparently it is also normal for HPPA shared libraries to have undefined symbols.
--no-undefined°¡ ¼³Á¤µÇ À־ °øÀ¯ °´Ã¼¿¡ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼À» Çã¿ëÇÑ´Ù. °á°úÀûÀ¸·Î º¸Åë °´Ã¼ÀÇ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼Àº ¿À·ù¸¦ ¹ß»ýÇÏÁö¸¸, °øÀ¯ °´Ã¼ÀÇ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼Àº ¹«½ÃµÈ´Ù. no_undefined´Â ½ÇÇà Áß ¸µÄ¿°¡ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼À» ó¸®ÇÏÁö ¸øÇÑ´Ù°í °¡Á¤ÇÑ´Ù. ±×·¯³ª ÃÖ¼ÒÇÑ ÇÑ ½Ã½ºÅÛÀº (BeOS) ¾î¶² ÇÔ¼ö°¡ ÇöÀç ¾ÆÅ°ÅØÃÄ¿¡ ÀûÇÕÇÑÁö ¼±ÅÃÇϱâ (¿¹¸¦ µé¾î µ¿ÀûÀ¸·Î Àû´çÇÑ memset ÇÔ¼ö¸¦ ¼±ÅÃÇÑ´Ù) À§Çؼ­ Ä¿³ÎÀÌ ·Îµù½Ã °íÄ¡±â ¶§¹®¿¡ °øÀ¯ ¶óÀ̺귯¸®ÀÇ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼Àº Á¤»óÀÌ´Ù. ¶ÇÇÑ HPPA °øÀ¯ ¶óÀ̺귯¸®µµ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼À» °¡Áú ¼ö ÀÖ´Ù.
--no-warn-mismatch
Normally ld will give an error if you try to link together input files that are mismatched for some reason, perhaps because they have been compiled for different processors or for different endiannesses. This option tells ld that it should silently permit such possible errors. This option should only be used with care, in cases when you have taken some special action that ensures that the linker errors are inappropriate.
ld´Â ÀÔ·ÂÆÄÀϵéÀÌ ´Ù¸¥ CPU³ª endianÀ» ´ë»óÀ¸·Î ÄÄÆÄÀÏ µÈ °Í°ú °°Àº ÀÌÀ¯·Î ÀÔ·ÂÆÄÀÏµé °£¿¡ ºÒÀÏÄ¡°¡ ¹ß°ßµÇ¸é ¿À·ù¸¦ ¹ß»ýÇÑ´Ù. ÀÌ ¿É¼ÇÀº ÀÌ·± ¿À·ù¸¦ Á¶¿ëÈ÷ ³Ñ¾î°¡°Ô ÇÑ´Ù. ÀÌ ¿É¼ÇÀº ¸µÄ¿ÀÇ ¿À·ù°¡ ºÎÀûÀýÇÑ °ÍÀÓÀÌ È®½ÇÇÑ °æ¿ì¿¡¸¸ ÁÖÀÇÀÖ°Ô »ç¿ëÇØ¾ß ÇÑ´Ù.
--no-whole-archive
Turn off the effect of the --whole-archive option for subsequent archive files.
´ÙÀ½ ¾ÆÄ«À̺ê ÆÄÀÏ¿¡ --whole-archive ¿É¼Ç È¿°ú¸¦ Á¦°ÅÇÑ´Ù.
--noinhibit-exec
Retain the executable output file whenever it is still usable. Normally, the linker will not produce an output file if it encounters errors during the link process; it exits without writing an output file when it issues any error whatsoever.
°¡´ÉÇÑ ½ÇÇà°¡´ÉÇÑ Ãâ·ÂÆÄÀÏÀ» º¸Á¸ÇÑ´Ù. ±âº»ÀûÀ¸·Î ¸µÄ¿´Â ¸µÅ© °úÁ¤¿¡¼­ ¿À·ù¸¦ ¸¸³ª¸é Ãâ·ÂÆÄÀÏÀ» ¸¸µéÁö ¾Ê´Â´Ù. ¿À·ù¸¦ Ãâ·ÂÇÏ°í Ãâ·ÂÆÄÀÏÀ» ¸¸µéÁö ¾Ê°í Á¾·áÇÑ´Ù.
--oformat output-format
ld may be configured to support more than one kind of object file. If your ld is configured this way, you can use the `--oformat' option to specify the binary format for the output object file. Even when ld is configured to support alternative object formats, you don't usually need to specify this, as ld should be configured to produce as a default output format the most usual format on each machine. output-format is a text string, the name of a particular format supported by the BFD libraries. (You can list the available binary formats with `objdump -i'.) The script command OUTPUT_FORMAT can also specify the output format, but this option overrides it. See section BFD.
ld´Â ¿©·¯ Á¾·ùÀÇ ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½ÄÀ» Áö¿øÇϵµ·Ï ¼³Á¤µÉ ¼ö ÀÖ´Ù. ÀÌ·¸°Ô ¼³Á¤µÇ¾ú´Ù¸é `--oformat' ¿É¼ÇÀ¸·Î Ãâ·Â ¿ÀºêÁ§Æ® ÆÄÀÏÀÇ Çü½ÄÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù. °¢ ÄÄÇ»ÅÍ¿¡ °¡Àå ÈçÇÑ Çü½ÄÀ» ±âº» Ãâ·Â Çü½ÄÀ¸·Î »ç¿ëÇϱ⠶§¹®¿¡ ÀÌ ¿É¼ÇÀ» Ç×»ó »ç¿ëÇÒ ÇÊ¿ä´Â ¾ø´Ù. output-format´Â ¹®ÀÚ¿­·Î BFD ¶óÀ̺귯¸®°¡ Áö¿øÇÏ´Â Çü½ÄÀÇ À̸§ÀÌ´Ù. (»ç¿ë°¡´ÉÇÑ Çü½ÄÀº `objdump -i'À¸·Î ¾Ë ¼ö ÀÖ´Ù.) ½ºÅ©¸³Æ® ¸í·É¾î OUTPUT_FORMATµµ Ãâ·Â Çü½ÄÀ» ÁöÁ¤ÇÏÁö¸¸, ÀÌ ¿É¼ÇÀÌ ¿ì¼±¼øÀ§¸¦ °¡Áø´Ù. BFD¸¦ Âü°íÇ϶ó.
-qmagic
This option is ignored for Linux compatibility.
ÀÌ ¿É¼ÇÀº Linux¿Í ȣȯÀ» À§ÇÑ °ÍÀ¸·Î, ¹«½ÃµÈ´Ù.
-Qy
This option is ignored for SVR4 compatibility.
ÀÌ ¿É¼ÇÀº SVR4¿Í ȣȯÀ» À§ÇÑ °ÍÀ¸·Î, ¹«½ÃµÈ´Ù.
--relax
An option with machine dependent effects. This option is only supported on a few targets. See section ld and the H8/300. See section ld and the Intel 960 family. On some platforms, the `--relax' option performs global optimizations that become possible when the linker resolves addressing in the program, such as relaxing address modes and synthesizing new instructions in the output object file. On some platforms these link time global optimizations may make symbolic debugging of the resulting executable impossible. This is known to be the case for the Matsushita MN10200 and MN10300 family of processors. On platforms where this is not supported, `--relax' is accepted, but ignored.
°¢ Ç÷¡Æû¿¡ µû¶ó ´Ù¸¥ ±â´ÉÀ» ÇÏ´Â ¿É¼ÇÀÌ´Ù. ÀÌ ¿É¼ÇÀº ¸î Ç÷¡Æû¿¡¼­¸¸ Áö¿øµÈ´Ù. ld and the H8/300¿Í ld and the Intel 960 family¸¦ Âü°íÇ϶ó. ¾î¶² Ç÷¡Æû¿¡¼­ `--relax' ¿É¼ÇÀº Ãâ·Â ¿ÀºêÁ§Æ® ÆÄÀÏ¿¡¼­ ÁÖ¼ÒÇü½ÄÀ» ¹Ù²Ù°Å³ª »õ·Î¿î ¸í·É¾î¸¦ ÇÕ¼ºÇÏ´Â °Í°ú °°ÀÌ ¸µÄ¿°¡ ÁÖ¼Ò¸¦ ¸®Á¹ºêÇÒ ¶§ °¡´ÉÇÑ Àü¿ª ÃÖÀûÈ­¸¦ ¼öÇàÇÏ°Ô ÇÑ´Ù. ¾î¶² Ç÷¡Æû¿¡¼­ ÀÌ Àü¿ª ÃÖÀûÈ­´Â °á°ú ÆÄÀÏ¿¡¼­ µð¹ö±× ½Éº¼À» »ç¿ëÇÒ ¼ö ¾ø°Ô ¸¸µç´Ù. ¿¹·Î Matsushita MN10200¿Í MN10300 °è¿­ÀÌ ±×·¯ÇÏ´Ù. ±âŸ Ç÷¡Æû¿¡¼­ ÀÌ ¿É¼ÇÀº ¹«½ÃµÈ´Ù.
--retain-symbols-file filename
Retain only the symbols listed in the file filename, discarding all others. filename is simply a flat file, with one symbol name per line. This option is especially useful in environments (such as VxWorks) where a large global symbol table is accumulated gradually, to conserve run-time memory. `--retain-symbols-file' does not discard undefined symbols, or symbols needed for relocations. You may only specify `--retain-symbols-file' once in the command line. It overrides `-s' and `-S'.
filename¿¡ ¿­°ÅµÈ ½Éº¼¸¸ À¯ÁöÇÏ°í, ´Ù¸¥ ½Éº¼µéÀº ¹ö¸°´Ù. filenameÀº ´Ü¼øÈ÷ ÇÑ ÁÙ¿¡ ÇϳªÀÇ ½Éº¼ À̸§ÀÌ ÀÖ´Â º¸Åë ÆÄÀÏÀÌ´Ù. ÀÌ ¿É¼ÇÀº ½ÇÇà Áß ¸Þ¸ð¸®¸¦ Àý¾àÇϱâ À§Çؼ­ Å« Àü¿ª ½Éº¼Ç¥¸¦ Á¡Â÷ ÃàÀûÇϴ ȯ°æ¿¡¼­ (VxWorks¿Í °°Àº) ƯÈ÷ À¯¿ëÇÏ´Ù. ÀÌ ¿É¼ÇÀº Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼À̳ª Àç¹èÄ¡¿¡ ÇÊ¿äÇÑ ½Éº¼Àº ¹ö¸®Áö ¾Ê´Â´Ù. ÀÌ ¿É¼ÇÀº ¸í·ÉÇà¿¡ Çѹø¸¸ »ç¿ëÇÒ ¼ö ÀÖ´Ù. ÀÌ ¿É¼ÇÀº `-s'¿Í `-S'¸¦ ¹«½ÃÇÑ´Ù.
-rpath dir
Add a directory to the runtime library search path. This is used when linking an ELF executable with shared objects. All -rpath arguments are concatenated and passed to the runtime linker, which uses them to locate shared objects at runtime. The -rpath option is also used when locating shared objects which are needed by shared objects explicitly included in the link; see the description of the -rpath-link option. If -rpath is not used when linking an ELF executable, the contents of the environment variable LD_RUN_PATH will be used if it is defined. The -rpath option may also be used on SunOS. By default, on SunOS, the linker will form a runtime search patch out of all the -L options it is given. If a -rpath option is used, the runtime search path will be formed exclusively using the -rpath options, ignoring the -L options. This can be useful when using gcc, which adds many -L options which may be on NFS mounted filesystems. For compatibility with other ELF linkers, if the -R option is followed by a directory name, rather than a file name, it is treated as the -rpath option.
µð·ºÅ丮¸¦ ½ÇÇà Áß ¶óÀ̺귯¸® °Ë»ö Æнº¿¡ Ãß°¡ÇÑ´Ù. ÀÌ ¿É¼ÇÀº ELF ½ÇÇàÆÄÀÏÀ» °øÀ¯ ¶óÀ̺귯¸®¿Í ¸µÅ©ÇÒ ¶§ »ç¿ëÇÑ´Ù. ¸ðµç -rpath ¾Æ±Ô¸ÕÆ®´Â ¸ð¾ÆÁ®¼­ ½ÇÇà Áß ¸µÄ¿°¡ °øÀ¯ °´Ã¼¸¦ ã´Âµ¥ »ç¿ëµÈ´Ù. ¶Ç ÀÌ ¿É¼ÇÀº ¸µÅ©¿¡ ¸í½ÃÀûÀ¸·Î Æ÷Ç﵃ ÇÊ¿ä°¡ ÀÖ´Â °øÀ¯ °´Ã¼¸¦ Áö½ÃÇϴµ¥µµ »ç¿ëµÈ´Ù. -rpath-link ¿É¼Ç ¼³¸íÀ» ÂüÁ¶Ç϶ó. ELF ½ÇÇàÆÄÀÏÀ» ¸µÅ©ÇÒ ¶§ ÀÌ ¿É¼ÇÀÌ »ç¿ëµÇÁö ¾Ê°í LD_RUN_PATH ȯ°æº¯¼ö°¡ Á¤ÀǵÇÀÖ´Ù¸é ÀÌ È¯°æº¯¼öÀÇ ³»¿ëÀÌ »ç¿ëµÈ´Ù. ÀÌ ¿É¼ÇÀº SunOS¿¡¼­µµ »ç¿ëÇÒ ¼ö ÀÖ´Ù. SunOS¿¡¼­ ±âº»ÀûÀ¸·Î ¸µÄ¿´Â ÁÖ¾îÁø -L ¿É¼ÇÀ¸·Î ½ÇÇà Áß °Ë»ö Æнº¸¦ ¸¸µç´Ù. ÀÌ ¿É¼ÇÀÌ »ç¿ëµÇ¸é -L ¿É¼ÇÀº ¹«½ÃÇÏ°í, ¿ÀÁ÷ ÀÌ ¿É¼Ç¸¸À¸·Î ½ÇÇà Áß °Ë»ö Æнº¸¦ ¸¸µç´Ù. ±×·¡¼­ gcc¿¡¼­ NFS·Î ¸¶¿îÆ®µÇ´Â ¿©·¯ ÆÄÀϽýºÅÛÀ» -L ¿É¼Ç°ú À¯¿ëÇÏ°Ô »ç¿ëÇÒ ¼ö ÀÖ´Ù. ´Ù¸¥ ELF ¸µÄ¿¿Í ȣȯÀ» À§ÇØ -R ¿É¼Ç µÚ¿¡ ÆÄÀÏÀ̸§ÀÌ ¾Æ´Ï¶ó µð·ºÅ丮 À̸§ÀÌ ¿Ã °æ¿ì -rpath ¿É¼ÇÀ¸·Î Ãë±ÞÇÑ´Ù. (¿ªÁÖ; DYNAMIC ¼¼±×¸ÕÆ®¿¡ RPATH ŸÀÔÀÇ Ç׸ñÀ» Ãß°¡ÇÑ´Ù. (¸µÅ© ¶§°¡ ¾Æ´Ï¶ó ½ÇÇà Áß) ÇöÀç µð·ºÅ丮¸¦ ³ªÅ¸³»´Â '.'µµ »ç¿ë°¡´ÉÇÏ´Ù.)
-rpath-link DIR
When using ELF or SunOS, one shared library may require another. This happens when an ld -shared link includes a shared library as one of the input files. When the linker encounters such a dependency when doing a non-shared, non-relocatable link, it will automatically try to locate the required shared library and include it in the link, if it is not included explicitly. In such a case, the -rpath-link option specifies the first set of directories to search. The -rpath-link option may specify a sequence of directory names either by specifying a list of names separated by colons, or by appearing multiple times. This option should be used with caution as it overrides the search path that may have been hard compiled into a shared library. In such a case it is possible to use unintentionally a different search path than the runtime linker would do. The linker uses the following search paths to locate required shared libraries.
ELF³ª SunOS¿¡¼­ °øÀ¯ ¶óÀ̺귯¸®´Â ´Ù¸¥ °øÀ¯ ¶óÀ̺귯¸®¸¦ ÇÊ¿ä·Î ÇÒ ¼ö ÀÖ´Ù. ÀÌ´Â ld -shared·Î °øÀ¯ ¶óÀ̺귯¸®¸¦ ÀÔ·ÂÆÄÀÏ¿¡ Æ÷ÇÔÇÑ °æ¿ì¿¡ ¹ß»ýÇÑ´Ù. ¸µÄ¿°¡ °øÀ¯µÇÁö ¾Ê°í Àç¹èÄ¡ºÒ°¡´ÉÇÑ ¸µÅ©¸¦ ÇÒ ¶§ ÀÌ·± ÀÇÁ¸¼ºÀ» ¹ß°ßÇϸé (¸í½ÃµÇÁö ¾Ê¾Ò¾îµµ) ÇÊ¿äÇÑ °øÀ¯ ¶óÀ̺귯¸®¸¦ ã¾Æ¼­ ¸µÅ©¿¡ Æ÷ÇÔ½ÃÅ°·Á°í ÇÑ´Ù. ÀÌ °æ¿ì ÀÌ ¿É¼ÇÀº óÀ½À¸·Î °Ë»öÇÒ µð·ºÅ丮 ÁýÇÕÀ» ÁöÁ¤ÇÑ´Ù. ÀÌ ¿É¼ÇÀº °¢ À̸§À» `:'À¸·Î ºÐ¸®Çϰųª ¿É¼ÇÀ» ¿©·¯¹ø »ç¿ëÇÏ¿© ÀÏ·ÃÀÇ µð·ºÅ丮¸¦ ÁöÁ¤ÇÑ´Ù. ÀÌ ¿É¼ÇÀº °øÀ¯ ¶óÀ̺귯¸®¿¡ ¾²¿©Áø °Ë»ö Æнº¸¦ ¹«È¿·Î ÇÒ ¼ö ÀÖÀ¸¹Ç·Î ÁÖÀÇÀÖ°Ô »ç¿ëÇØ¾ß ÇÑ´Ù. ¾î¶² °æ¿ì¿¡ ÀǵµÇÏÁö ¾Ê°Ô ½ÇÇà Áß ¸µÄ¿¿Í ´Ù¸¥ °Ë»ö Æнº¸¦ »ç¿ëÇÒ ¼öµµ ÀÖ´Ù. ¸µÄ¿´Â ÇÊ¿äÇÑ °øÀ¯ ¶óÀ̺귯¸®¸¦ ã±â À§ÇØ ´ÙÀ½ °Ë»ö Æнº¸¦ »ç¿ëÇÑ´Ù.
  1. Any directories specified by -rpath-link options.
  2. Any directories specified by -rpath options. The difference between -rpath and -rpath-link is that directories specified by -rpath options are included in the executable and used at runtime, whereas the -rpath-link option is only effective at link time. It is for the native linker only.
  3. On an ELF system, if the -rpath and rpath-link options were not used, search the contents of the environment variable LD_RUN_PATH. It is for the native linker only.
  4. On SunOS, if the -rpath option was not used, search any directories specified using -L options.
  5. For a native linker, the contents of the environment variable LD_LIBRARY_PATH.
  6. For a native ELF linker, the directories in DT_RUNPATH or DT_RPATH of a shared library are searched for shared libraries needed by it. The DT_RPATH entries are ignored if DT_RUNPATH entries exist.
  7. The default directories, normally `/lib' and `/usr/lib'.
  8. For a native linker on an ELF system, if the file `/etc/ld.so.conf' exists, the list of directories found in that file.
If the required shared library is not found, the linker will issue a warning and continue with the link.
  1. -rpath-link ¿É¼ÇÀ¸·Î ÁöÁ¤µÈ µð·ºÅ丮µé
  2. -rpath ¿É¼ÇÀ¸·Î ÁöÁ¤µÈ µð·ºÅ丮µé. -rpath°ú -rpath-linkÀÇ Â÷ÀÌ´Â -rpath´Â ½ÇÇàÆÄÀÏ¿¡ Æ÷ÇÔµÇ°í ½ÇÇà Áß¿¡ »ç¿ëµÇ´Â ¹Ý¸é -rpath-link´Â ¿ÀÁ÷ ¸µÅ© ½Ã¿¡ »ç¿ëµÈ´Ù´Â Á¡ÀÌ´Ù. ÀÌ´Â ±âº» ¸µÄ¿¿¡¸¸ Àû¿ëµÈ´Ù.
  3. ELF ½Ã½ºÅÛ¿¡¼­ -rpath°ú -rpath-link ¿É¼ÇÀÌ »ç¿ëµÇÁö ¾Ê¾Ò´Ù¸é ȯ°æº¯¼ö LD_RUN_PATHÀÇ ³»¿ëÀ» °Ë»öÇÑ´Ù. ÀÌ´Â ±âº» ¸µÄ¿¿¡¸¸ Àû¿ëµÈ´Ù.
  4. SunOS¿¡¼­ -rpath°¡ »ç¿ëµÇÁö ¾Ê¾Ò´Ù¸é -L ¿É¼ÇÀ¸·Î ÁÖ¾îÁø µð·ºÅ丮¸¦ °Ë»öÇÑ´Ù.
  5. ±âº» ¸µÄ¿¿¡¼­ ȯ°æº¯¼ö LD_LIBRARY_PATHÀÇ ³»¿ë
  6. ±âº» ELF ¸µÄ¿¿¡¼­ °øÀ¯ ¶óÀ̺귯¸®ÀÇ DT_RUNPATH³ª DT_RPATH¿¡ ÀúÀåµÈ µð·ºÅ丮°¡ °Ë»öµÈ´Ù. DT_RUNPATH Ç׸ñÀÌ ÀÖ´Ù¸é DT_RPATH Ç׸ñÀº ¹«½ÃµÈ´Ù.
  7. º¸Åë `/lib'°ú `/usr/lib' °°Àº ±âº» µð·ºÅ丮
  8. ELF ½Ã½ºÅÛÀÇ ±âº» ¸µÄ¿¿¡¼­ ÆÄÀÏ `/etc/ld.so.conf'ÀÌ Á¸ÀçÇÑ´Ù¸é ÀÌ ÆÄÀÏ ¾ÈÀÇ µð·ºÅ丮 ¸ñ·Ï
ÇÊ¿äÇÑ °øÀ¯ ¶óÀ̺귯¸®°¡ ¹ß°ßµÇÁö ¾ÊÀ¸¸é ¸µÄ¿´Â °æ°í¸¦ Ãâ°ÝÇÏ°í ¸µÅ©¸¦ °è¼ÓÇÑ´Ù.
-shared
-Bshareable
Create a shared library. This is currently only supported on ELF, XCOFF and SunOS platforms. On SunOS, the linker will automatically create a shared library if the -e option is not used and there are undefined symbols in the link.
°øÀ¯ ¶óÀ̺귯¸®¸¦ ¸¸µç´Ù. ÀÌ ¿É¼ÇÀº ÇöÀç ELF, XCOFF, SunOS Ç÷¡Æû¿¡¼­¸¸ Áö¿øµÈ´Ù. SunOS¿¡¼­ -e ¿É¼ÇÀÌ »ç¿ëµÇÁö ¾Ê°í ¸µÅ©¿¡ Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼ÀÌ ÀÖ´Ù¸é ¸µÄ¿´Â ÀÚµ¿À¸·Î °øÀ¯ ¶óÀ̺귯¸®¸¦ ¸¸µç´Ù.
--sort-common
This option tells ld to sort the common symbols by size when it places them in the appropriate output sections. First come all the one byte symbols, then all the two bytes, then all the four bytes, and then everything else. This is to prevent gaps between symbols due to alignment constraints.
ÀÌ ¿É¼ÇÀº ld°¡ °øÅë ½Éº¼À» Àû´çÇÑ Ãâ·Â ¼½¼Ç¿¡ À§Ä¡ÇÒ ¶§ Å©±â ¼øÀ¸·Î Á¤·ÄÇÏ°Ô ÇÑ´Ù. 1 ¹ÙÀÌÆ® ½Éº¼µéÀº óÀ½¿¡ ³ª¿À°í, ´ÙÀ½¿¡ 2 ¹ÙÀÌÆ®ÀÇ, ´ÙÀ½¿¡ 4 ¹ÙÀÌÆ®ÀÇ, µîµî. ±×·¡¼­ Á¤·Ä Á¦ÇÑÀ¸·Î ÀÎÇÑ ½Éº¼»çÀÌÀÇ °ø°£À» ÁÙÀδÙ.
--split-by-file [size]
Similar to --split-by-reloc but creates a new output section for each input file when size is reached. size defaults to a size of 1 if not given.
--split-by-reloc°ú ºñ½ÁÇÏÁö¸¸, °¢ ÀÔ·ÂÆÄÀÏ¿¡ ´ëÇؼ­ size¸¦ ³ÑÀ» ¶§¸¶´Ù »õ·Î¿î Ãâ·Â ¼½¼ÇÀ» ¸¸µç´Ù. sizeÀÌ ÁÖ¾îÁöÁö ¾ÊÀ¸¸é 1ÀÌ »ç¿ëµÈ´Ù.
--split-by-reloc [count]
Tries to creates extra sections in the output file so that no single output section in the file contains more than count relocations. This is useful when generating huge relocatable files for downloading into certain real time kernels with the COFF object file format; since COFF cannot represent more than 65535 relocations in a single section. Note that this will fail to work with object file formats which do not support arbitrary sections. The linker will not split up individual input sections for redistribution, so if a single input section contains more than count relocations one output section will contain that many relocations. count defaults to a value of 32768.
Ãâ·ÂÆÄÀÏ¿¡ º°µµÀÇ ¼½¼ÇÀ» ¸¸µé¾î¼­ °¢ Ãâ·Â ¼½¼Ç¿¡ Àç¹èÄ¡°¡ count ÀÌ»óÀ» Æ÷ÇÔÇÏÁö ¾Êµµ·Ï ÇÑ´Ù. ÀÌ´Â COFF Çü½ÄÀÌ ÇÑ ¼½¼Ç¿¡ Àç¹èÄ¡¸¦ 65535°³ ÀÌ»ó Æ÷ÇÔÇÏÁö ¸øÇϱ⠶§¹®¿¡, COFF¸¦ »ç¿ëÇÏ´Â ¸®¾óŸÀÓ Ä¿³Î¿¡ ´Ù¿î·ÎµåÇÒ Å« Àç¹èÄ¡°¡´É ÆÄÀÏÀ» »ý¼ºÇÒ ¶§ À¯¿ëÇÏ´Ù. ÁÖÀÇ! ÀÌ ¿É¼ÇÀº ÀÓÀÇÀÇ ¼½¼ÇÀ» Áö¿øÇÏÁö ¾Ê´Â ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½Ä°ú ÇÔ²² »ç¿ëµÉ ¼ö ¾ø´Ù. ¸µÄ¿´Â ÀÔ·Â ¼½¼Ç ÀÚü¸¦ ³ª´©Áö´Â ¾Ê´Â´Ù. ±×·¡¼­ ÀÔ·Â ¼½¼ÇÀÇ Àç¹èÄ¡°¡ count °³ ÀÌ»óÀÌ´õ¶óµµ ±×´ë·Î Ãâ·Â ¼½¼Ç¿¡ ¾²¿©Áø´Ù. ±âº» count °ªÀº 32768ÀÌ´Ù.
--stats
Compute and display statistics about the operation of the linker, such as execution time and memory usage.
½ÇÇà ½Ã°£À̳ª ¸Þ¸ð¸® »ç¿ë·®°ú °°Àº ¸µÄ¿ ½ÇÇà¿¡ ´ëÇÑ Åë°è¸¦ Ãâ·ÂÇÑ´Ù.
--traditional-format
For some targets, the output of ld is different in some ways from the output of some existing linker. This switch requests ld to use the traditional format instead. For example, on SunOS, ld combines duplicate entries in the symbol string table. This can reduce the size of an output file with full debugging information by over 30 percent. Unfortunately, the SunOS dbx program can not read the resulting program (gdb has no trouble). The `--traditional-format' switch tells ld to not combine duplicate entries.
¾î¶² Ç÷¡Æû¿¡¼­ ldÀÇ Ãâ·Â ¹æ½ÄÀÌ ÀÌ¹Ì Á¸ÀçÇÏ´Â ¸µÄ¿¿Í ´Ù¸¦ ¼ö ÀÖ´Ù. ÀÌ ¿É¼ÇÀº ld°¡ ´ë½Å ÀüÅëÀûÀÎ Çü½ÄÀ» »ç¿ëÇÏ°Ô ÇÑ´Ù. SunOSÀÇ ¿¹¸¦ µé¸é, ld´Â ½Éº¼¹®ÀÚ¿­Ç¥¿¡ ¹Ýº¹µÇ´Â Ç׸ñÀ» Æ÷ÇÔÇÑ´Ù. ±×·¡¼­ ¸¹Àº µð¹ö±ë Á¤º¸¸¦ °¡Áø Ãâ·ÂÆÄÀÏÀÇ Å©±â¸¦ 30% ÀÌ»ó ÁÙÀδÙ. ±×·¯³ª SunOSÀÇ dbx´Â ÀÌ °á°ú¸¦ ÀÐÀ» ¼ö ¾ø´Ù. (gdb´Â ¹®Á¦¾ø´Ù.) ÀÌ °æ¿ì `--traditional-format' ¿É¼ÇÀº ¹Ýº¹µÇ´Â Ç׸ñÀ» ÇÕÄ¡Áö ¾Ê°Ô ÇÑ´Ù.
--section-start sectionname=org
Locate a section in the output file at the absolute address given by org. You may use this option as many times as necessary to locate multiple sections in the command line. org must be a single hexadecimal integer; for compatibility with other linkers, you may omit the leading `0x' usually associated with hexadecimal values. Note: there should be no white space between sectionname, the equals sign ("="), and org.
¼½¼ÇÀ» Àý´ë ÁÖ¼Ò org¿¡ À§Ä¡ÇÑ´Ù. ÀÌ ¿É¼ÇÀ» ¼­·Î ´Ù¸¥ ¼½¼Ç¿¡ ´ëÇؼ­ ¿©·¯¹ø »ç¿ëÇÒ ¼ö ÀÖ´Ù. ´Ù¸¥ ¸µÄ¿¿Í ȣȯÀ» À§ÇØ org´Â 16 Áø¼ö Á¤¼öÀÌ´Ù. º¸Åë 16 Áø¼ö°ª°ú °°ÀÌ ¾²ÀÌ´Â ¾ÕÀÇ `0x'´Â »ý·«ÀÌ °¡´ÉÇÏ´Ù. ÁÖÀÇ: sectionname°ú µîÈ£ ("="), org »çÀÌ¿¡ °ø¹éÀÌ ÀÖÀ¸¸é ¾ÈµÈ´Ù.
-Tbss org
-Tdata org
-Ttext org
Use org as the starting address for--respectively--the bss, data, or the text segment of the output file. org must be a single hexadecimal integer; for compatibility with other linkers, you may omit the leading `0x' usually associated with hexadecimal values.
orgÀ» Ãâ·ÂÆÄÀÏ¿¡¼­ °¢°¢ bss, data, text ºÎºÐÀÇ ½ÃÀÛ ÁÖ¼Ò·Î »ç¿ëÇÑ´Ù. ´Ù¸¥ ¸µÄ¿¿Í ȣȯÀ» À§ÇØ org´Â 16 Áø¼ö Á¤¼öÀÌ´Ù. º¸Åë 16 Áø¼ö°ª°ú °°ÀÌ ¾²ÀÌ´Â ¾ÕÀÇ `0x'´Â »ý·«ÀÌ °¡´ÉÇÏ´Ù.
--dll-verbose
--verbose
Display the version number for ld and list the linker emulations supported. Display which input files can and cannot be opened. Display the linker script if using a default builtin script.
ldÀÇ ¹öÀü°ú Áö¿øÇÏ´Â ¸µÄ¿ ¿¡¹Ä·¹À̼ÇÀ» Ãâ·ÂÇÑ´Ù. ÀÔ·ÂÆÄÀÏÀ» ¿­ ¼ö ÀÖ´ÂÁö ¾ø´ÂÁöµµ Ãâ·ÂÇÑ´Ù. ±âº» ½ºÅ©¸³Æ®¸¦ »ç¿ëÇÑ´Ù¸é ¸µÄ¿ ½ºÅ©¸³Æ®µµ Ãâ·ÂÇÑ´Ù.
--version-script=version-scriptfile
Specify the name of a version script to the linker. This is typically used when creating shared libraries to specify additional information about the version heirarchy for the library being created. This option is only meaningful on ELF platforms which support shared libraries. See section VERSION Command.
¹öÀü ½ºÅ©¸³Æ® À̸§À» ÁöÁ¤ÇÑ´Ù. ÀÌ´Â °øÀ¯ ¶óÀ̺귯¸®¿¡ ¶óÀ̺귯¸® ¹öÀü °èÃþ±¸Á¶¿¡ ´ëÇÑ Ãß°¡ Á¤º¸¸¦ ÀúÀåÇÒ ¶§ º¸Åë »ç¿ëÇÑ´Ù. ÀÌ ¿É¼ÇÀº °øÀ¯ ¶óÀ̺귯¸®¸¦ Áö¿øÇÏ´Â ELF Ç÷¡Æû¿¡¼­¸¸ Àǹ̰¡ ÀÖ´Ù. VERSION Command¸¦ ÂüÁ¶Ç϶ó.
--warn-common
Warn when a common symbol is combined with another common symbol or with a symbol definition. Unix linkers allow this somewhat sloppy practice, but linkers on some other operating systems do not. This option allows you to find potential problems from combining global symbols. Unfortunately, some C libraries use this practice, so you may get some warnings about symbols in the libraries as well as in your programs. There are three kinds of global symbols, illustrated here by C examples:
°øÅë ½Éº¼ÀÌ ´Ù¸¥ °øÅë ½Éº¼À̳ª ½Éº¼ Á¤ÀÇ¿Í °áÇÕµÉ ¶§ °æ°íÇÑ´Ù. À¯´Ð½º ¸µÄ¿´Â ÀÌ ´Ù¼Ò ÀÌ»óÇÑ ÀÏÀ» Çã¿ëÇÏÁö¸¸, ´Ù¸¥ ¿î¿µÃ¼Á¦ÀÇ ¸µÄ¿´Â ±×·¸Áö ¾Ê´Ù. ÀÌ ¿É¼ÇÀº Àü¿ª ½Éº¼À» °áÇÕÇÒ ¶§ ¹ß»ýÇÒ ¼ö ÀÖ´Â ÀáÁ¦Àû ¹®Á¦¸¦ ã´Âµ¥ µµ¿òÀÌ µÈ´Ù. ºÒÇàÈ÷µµ ¸î¸î C ¶óÀ̺귯¸®´Â ÀÌ·± °üÇàÀ» ÀÌ¿ëÇϱ⠶§¹®¿¡ ÇÁ·Î±×·¥ÀÌ ¾Æ´Ï¶ó ¶óÀ̺귯¸®ÀÇ ½Éº¼¿¡ ´ëÇÑ °æ°íµµ ¾òÀ» ¼ö ÀÖ´Ù.
`int i = 1;'
A definition, which goes in the initialized data section of the output file.
`extern int i;'
An undefined reference, which does not allocate space. There must be either a definition or a common symbol for the variable somewhere.
`int i;'
A common symbol. If there are only (one or more) common symbols for a variable, it goes in the uninitialized data area of the output file. The linker merges multiple common symbols for the same variable into a single symbol. If they are of different sizes, it picks the largest size. The linker turns a common symbol into a declaration, if there is a definition of the same variable.

`int i = 1;'
Á¤ÀÇ´Â Ãâ·ÂÆÄÀÏÀÇ ÃʱâÈ­µÈ ÀÚ·á ¼½¼Ç¿¡ ÀúÀåµÈ´Ù.
`extern int i;'
°ø°£À» ÇÒ´çÇÏÁö ¾Ê´Â Á¤ÀǵÇÁö ¾ÊÀº ÂüÁ¶ÀÌ´Ù. ¹Ýµå½Ã ´Ù¸¥ °÷¿¡ º¯¼öÀÇ Á¤Àdzª °øÀ¯ ½Éº¼ÀÌ ÀÖ¾î¾ß ÇÑ´Ù.
`int i;'
°øÅë ½Éº¼ÀÌ´Ù. º¯¼ö¿¡ ´ëÇؼ­ ¿ÀÁ÷ °øÅë ½Éº¼¸¸ÀÌ ÀÖ´Ù¸é Ãâ·ÂÆÄÀÏÀÇ ÃʱâÈ­µÇÁö¾ÊÀº ÀÚ·á ¼½¼Ç¿¡ ÀúÀåµÈ´Ù. ¸µÄ¿´Â °°Àº º¯¼öÀÇ ¿©·¯ °øÅë ½Éº¼À» ÇÑ ½Éº¼·Î ÇÕÄ£´Ù. ±×µéÀÌ ¼­·Î ´Ù¸¥ Å©±â¸¦ °¡Áö¸é °¡Àå Å« Å©±â¸¦ ¼±ÅÃÇÑ´Ù. °°Àº º¯¼öÀÇ Á¤ÀÇ°¡ ÀÖ´Ù¸é ¸µÄ¿´Â °øÅë ½Éº¼À» °°Àº ¼±¾ðÀ¸·Î º¯È¯ÇÑ´Ù.
The `--warn-common' option can produce five kinds of warnings. Each warning consists of a pair of lines: the first describes the symbol just encountered, and the second describes the previous symbol encountered with the same name. One or both of the two symbols will be a common symbol.
`--warn-common' ¿É¼ÇÀº ´Ù¼¸ °¡Áö Á¾·ùÀÇ °æ°í¸¦ Ãâ·ÂÇÑ´Ù. °¢ °æ°í´Â µÎ ÁÙÀÌ´Ù. ù ÁÙÀº ¹ß°ßµÈ ½Éº¼À», µÎ¹ø° ÁÙÀº °°Àº À̸§À¸·Î ÀÌ¹Ì ¹ß°ßÇÑ ½Éº¼À» ¼³¸íÇÑ´Ù. µÎ ½Éº¼ Áß Çϳª ÀÌ»óÀÌ °øÅë ½Éº¼ÀÌ´Ù.
  1. Turning a common symbol into a reference, because there is already a definition for the symbol.
    file(section): warning: common of `symbol'
       overridden by definition
    file(section): warning: defined here
    
  2. Turning a common symbol into a reference, because a later definition for the symbol is encountered. This is the same as the previous case, except that the symbols are encountered in a different order.
    file(section): warning: definition of `symbol'
       overriding common
    file(section): warning: common is here
    
  3. Merging a common symbol with a previous same-sized common symbol.
    file(section): warning: multiple common
       of `symbol'
    file(section): warning: previous common is here
    
  4. Merging a common symbol with a previous larger common symbol.
    file(section): warning: common of `symbol'
       overridden by larger common
    file(section): warning: larger common is here
    
  5. Merging a common symbol with a previous smaller common symbol. This is the same as the previous case, except that the symbols are encountered in a different order.
    file(section): warning: common of `symbol'
       overriding smaller common
    file(section): warning: smaller common is here
    

  1. ½Éº¼¿¡ ´ëÇÑ Á¤ÀÇ°¡ ÀÌ¹Ì Àֱ⠶§¹®¿¡ °øÅë ½Éº¼À» ÂüÁ¶·Î º¯È¯ÇÑ´Ù.
    file(section): warning: common of `symbol'
       overridden by definition
    file(section): warning: defined here
    
  2. ³ªÁß¿¡ ½Éº¼¿¡ ´ëÇÑ Á¤ÀÇ°¡ ¹ß°ßµÇ¾ú±â ¶§¹®¿¡ °øÅë ½Éº¼À» ÂüÁ¶·Î º¯È¯ÇÑ´Ù. ÀÌ´Â ½Éº¼ÀÌ ¹Ý´ë ¼ø¼­·Î ¹ß°ßµÈ °ÍÀ» Á¦¿ÜÇÏ°í ÀüÀÇ °æ¿ì¿Í °°´Ù.
    file(section): warning: definition of `symbol'
       overriding common
    file(section): warning: common is here
    
  3. °øÅë ½Éº¼À» ÀüÀÇ °°Àº Å©±âÀÇ °øÅë ½Éº¼°ú ÇÕÄ£´Ù.
    file(section): warning: multiple common
       of `symbol'
    file(section): warning: previous common is here
    
  4. °øÅë ½Éº¼À» ÀüÀÇ ´õ Å« °øÅë ½Éº¼°ú ÇÕÄ£´Ù.
    file(section): warning: common of `symbol'
       overridden by larger common
    file(section): warning: larger common is here
    
  5. °øÅë ½Éº¼À» ÀüÀÇ ´õ Å« °øÅë ½Éº¼°ú ÇÕÄ£´Ù. ÀÌ´Â ½Éº¼ÀÌ ¹Ý´ë ¼ø¼­·Î ¹Ý°ßµÈ °ÍÀ» Á¦¿ÜÇÏ°í ÀüÀÇ °æ¿ì¿Í °°´Ù.
    file(section): warning: common of `symbol'
       overriding smaller common
    file(section): warning: smaller common is here
    
--warn-constructors
Warn if any global constructors are used. This is only useful for a few object file formats. For formats like COFF or ELF, the linker can not detect the use of global constructors.
¾î¶² Àü¿ª »ý¼ºÀÚ°¡ »ç¿ëµÇ¸é °æ°íÇÑ´Ù. ¸î¸î ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½Ä¿¡¸¸ À¯¿ëÇÏ´Ù. ¸µÄ¿´Â COFF³ª ELF °°Àº Çü½Ä¿¡¼­ Àü¿ª »ý¼ºÀÚ »ç¿ëÀ» ¹ß°ßÇÏÁö ¸øÇÑ´Ù.
--warn-multiple-gp
Warn if multiple global pointer values are required in the output file. This is only meaningful for certain processors, such as the Alpha. Specifically, some processors put large-valued constants in a special section. A special register (the global pointer) points into the middle of this section, so that constants can be loaded efficiently via a base-register relative addressing mode. Since the offset in base-register relative mode is fixed and relatively small (e.g., 16 bits), this limits the maximum size of the constant pool. Thus, in large programs, it is often necessary to use multiple global pointer values in order to be able to address all possible constants. This option causes a warning to be issued whenever this case occurs.
Ãâ·Â ÆÄÀÏ¿¡ ¿©·¯ Àü¿ª Æ÷ÀÎÅÍ°ªÀÌ ÇÊ¿äÇÏ´Ù¸é °æ°íÇÑ´Ù. ÀÌ´Â Alpha¿Í °°Àº ƯÁ¤ ÇÁ·Î¼¼¼­¿¡¸¸ Àǹ̰¡ ÀÖ´Ù. ¾î¶² ÇÁ·Î¼¼¼­´Â Ưº°ÇÑ ¼½¼Ç¿¡ Å« °ªÀÇ »ó¼ö¸¦ Áý¾î³ÖÀ» ¼ö ÀÖ´Ù. Ưº° ·¹Áö½ºÅÍ(GP, Àü¿ª Æ÷ÀÎÅÍ)´Â ÀÌ ¼½¼ÇÀÇ Áß¾ÓÀ» °¡¸®ÄѼ­ º£À̽º ·¹Áö½ºÅÍ »ó´ë ÁÖ¼Ò Çü½ÄÀ¸·Î »ó¼ö¸¦ È¿À²ÀûÀ¸·Î ÀоîµéÀÏ ¼ö ÀÖ´Ù. º£À̽º ·¹Áö½ºÅÍ »ó´ë ÁÖ¼Ò Çü½Ä¿¡¼­ ¿É¼ÂÀº º¯ÇÏÁö¾Ê°í »ó´ëÀûÀ¸·Î À۱⠶§¹®¿¡ (¿¹¸¦ µé¾î 16 ºñÆ®), ÀÌ ¿É¼ÇÀº »ó¼öÇ®(pool)ÀÇ ÃÖ´ë Å©±â¸¦ Á¦ÇÑÇÑ´Ù. ±×·¡¼­ Å« ÇÁ·Î±×·¥¿¡¼­´Â ¸ðµç »ó¼öÀÇ ÁÖ¼Ò¸¦ Áö½ÃÇϱâ À§Çؼ­ Àü¿ª Æ÷ÀÎÅÍ°ªÀ» ¿©·¯°³ »ç¿ëÇÒ ÇÊ¿ä°¡ ÀÖ´Ù. ÀÌ ¿É¼ÇÀº ÀÌ·± °æ¿ì°¡ ¹ß»ýÇÒ ¶§ °æ°í¸¦ ³½´Ù.
--warn-once
Only warn once for each undefined symbol, rather than once per module which refers to it.
Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼¿¡ ´ëÇؼ­ À̸¦ ÂüÁ¶ÇÏ´Â ¸ðµâ ¸¶´Ù °æ°íÇÏÁö ¾Ê°í °¢ ½Éº¼ ´ç Çѹø¸¸ °æ°íÇÑ´Ù.
--warn-section-align
Warn if the address of an output section is changed because of alignment. Typically, the alignment will be set by an input section. The address will only be changed if it not explicitly specified; that is, if the SECTIONS command does not specify a start address for the section (see section SECTIONS command).
Á¤·Ä¶§¹®¿¡ Ãâ·Â ¼½¼Ç ÁÖ¼Ò°¡ º¯°æµÇ¸é °æ°íÇÑ´Ù. º¸Åë Á¤·ÄÀº ÀÔ·Â ¼½¼Ç¿¡¼­ ÁöÁ¤µÈ´Ù. ÁÖ¼Ò°¡ ¸í½ÃÀûÀ¸·Î ÁöÁ¤µÇÁö ¾Ê¾Ò´Ù¸é, Áï SECTIONS ¸í·É¾î°¡ ¼½¼ÇÀÇ ½ÃÀÛ ÁÖ¼Ò¸¦ ÁöÁ¤ÇÏÁö ¾Ê¾Ò´Ù¸é, ÁÖ¼Ò¸¦ º¯°æÇÑ´Ù. (SECTIONS command¸¦ ÂüÁ¶Ç϶ó.)
--whole-archive
For each archive mentioned on the command line after the --whole-archive option, include every object file in the archive in the link, rather than searching the archive for the required object files. This is normally used to turn an archive file into a shared library, forcing every object to be included in the resulting shared library. This option may be used more than once. Two notes when using this option from gcc: First, gcc doesn't know about this option, so you have to use -Wl,-whole-archive. Second, don't forget to use -Wl,-no-whole-archive after your list of archives, because gcc will add its own list of archives to your link and you may not want this flag to affect those as well.
ÀÌ ¿É¼Ç µÚ¿¡ ³ª¿À´Â ¾ÆÄ«À̺꿡¼­ ÇÊ¿äÇÑ ¿ÀºêÁ§Æ® ÆÄÀϸ¸À» ãÁö ¾Ê°í ¾ÆÄ«À̺êÀÇ ¸ðµç ¿ÀºêÁ§Æ® ÆÄÀÏÀ» Æ÷ÇÔÇÑ´Ù. ÀÌ´Â º¸Åë ¾ÆÄ«À̺ê ÆÄÀÏÀ» °øÀ¯ ¶óÀ̺귯¸®·Î º¯È¯ÇÒ ¶§ ¸ðµç °´Ã¼¸¦ °øÀ¯ ¶óÀ̺귯¸®¿¡ Æ÷ÇÔ½ÃÅ°±â À§Çؼ­ ¾²ÀδÙ. ÀÌ ¿É¼ÇÀº ¿©·¯¹ø »ç¿ëÇÒ ¼ö ÀÖ´Ù.
--wrap symbol
Use a wrapper function for symbol. Any undefined reference to symbol will be resolved to __wrap_symbol. Any undefined reference to __real_symbol will be resolved to symbol. This can be used to provide a wrapper for a system function. The wrapper function should be called __wrap_symbol. If it wishes to call the system function, it should call __real_symbol. Here is a trivial example:
symbol¿¡ ´ëÇÑ ·¡ÆÛ(wrapper) ÇÔ¼ö¸¦ »ç¿ëÇÑ´Ù. symbol·Î Á¤ÀǵÇÁö ¾ÊÀº ÂüÁ¶´Â __wrap_symbol·Î ¸®Á¹ºêµÈ´Ù. __real_symbol·Î Á¤ÀǵÇÁö ¾ÊÀº ÂüÁ¶´Â symbol·Î ¸®Á¹ºêµÈ´Ù. ÀÌ ¿É¼ÇÀº ½Ã½ºÅÛ ÇÔ¼ö¿¡ ·¡ÆÛ¸¦ Á¦°øÇϱâ À§Çؼ­ »ç¿ëµÈ´Ù. ·¡ÆÛ ÇÔ¼ö´Â __wrap_symbol·Î È£ÃâµÈ´Ù. ½Ã½ºÅÛ ÇÔ¼ö¸¦ »ç¿ëÇÏ°í ½Í´Ù¸é __real_symbolÀ» È£ÃâÇÏ¸é µÈ´Ù. ¿©±â °£´ÜÇÑ ¿¹°¡ ÀÖ´Ù.
void *
__wrap_malloc (int c)
{
  printf ("malloc called with %ld\n", c);
  return __real_malloc (c);
}
If you link other code with this file using --wrap malloc, then all calls to malloc will call the function __wrap_malloc instead. The call to __real_malloc in __wrap_malloc will call the real malloc function. You may wish to provide a __real_malloc function as well, so that links without the --wrap option will succeed. If you do this, you should not put the definition of __real_malloc in the same file as __wrap_malloc; if you do, the assembler may resolve the call before the linker has a chance to wrap it to malloc.
ÀÌ ÆÄÀÏÀ» --wrap mallocÀ» »ç¿ëÇÏ¿© ´Ù¸¥ ÄÚµå¿Í ¸µÅ©ÇÏ¸é ¸ðµç malloc È£ÃâÀº ´ë½Å __wrap_mallocÀ» È£ÃâÇÑ´Ù. __wrap_malloc¿¡¼­ __real_mallocÀº ½ÇÁ¦ malloc ÇÔ¼ö¸¦ È£ÃâÇÑ´Ù. __real_malloc ÇÔ¼öµµ ¸¸µé¾î¼­ --wrap ¿É¼Ç ¾øÀ̵µ ¸µÅ©°¡ ¼º°øÇÏ°Ô ÇÒ ¼ö ÀÖ´Ù. ¸¸¾à ±×·¸´Ù¸é __real_mallocÀÇ Á¤ÀǸ¦ __wrap_malloc°ú °°Àº ÆÄÀÏ¿¡ ³ÖÁö¸¶¶ó. ±×·¸´Ù¸é ¸µÄ¿°¡ À̸¦ mallocÀ¸·Î ·¡ÆÛÇϱâ Àü¿¡ ¾î¼Àºí·¯°¡ È£ÃâÀ» °¡·Îä¼­ ¸ÕÀú ¸®Á¹ºêÇÒ ¼ö ÀÖ´Ù.
--enable-new-dtags
--disable-new-dtags
This linker can create the new dynamic tags in ELF. But the older ELF systems may not understand them. If you specify --enable-new-dtags, the dynamic tags will be created as needed. If you specify --disable-new-dtags, no new dynamic tags will be created. By default, the new dynamic tags are not created. Note that those options are only available for ELF systems.
¸µÄ¿´Â ELF¿¡ »õ·Î¿î µ¿Àû ű׸¦ ¸¸µé ¼ö ÀÖ´Ù. ±×·¯³ª ¿À·¡µÈ ELF ½Ã½ºÅÛÀº À̸¦ ÀÌÇØÇÏÁö ¸øÇÒ ¼ö ÀÖ´Ù. --enable-new-dtags¸¦ »ç¿ëÇϸé ÇÊ¿äÇÑ µ¿Àû űװ¡ ¸¸µé¾î Áø´Ù. --disable-new-dtags¸¦ »ç¿ëÇÏ¸é ¾î¶°ÇÑ »õ·Î¿î µ¿Àû ű׵µ ¸¸µéÁö ¾Ê´Â´Ù. ±âº»ÀûÀ¸·Î »õ·Î¿î µ¿Àû ű״ ¸¸µéÁö ¾Ê´Â´Ù. ÀÌ ¿É¼ÇÀº ELF ½Ã½ºÅÛ¿¡¼­ Á¦°øµÈ´Ù.

i386 PE Ç÷¡Æû ƯÀ¯ÀÇ ¿É¼Ç

The i386 PE linker supports the -shared option, which causes the output to be a dynamically linked library (DLL) instead of a normal executable. You should name the output *.dll when you use this option. In addition, the linker fully supports the standard *.def files, which may be specified on the linker command line like an object file (in fact, it should precede archives it exports symbols from, to ensure that they get linked in, just like a normal object file).

i386 PE (¿ªÁÖ, win32 portable executable ½ÇÇàÆÄÀÏ Çü½Ä) ¸µÄ¿´Â Ãâ·ÂÀÌ º¸Åë ½ÇÇàÆÄÀÏ ´ë½Å¿¡ µ¿Àû ¸µÅ© ¶óÀ̺귯¸®·Î (DLL) ¸¸µå´Â -shared ¿É¼ÇÀ» Áö¿øÇÑ´Ù. ÀÌ ¿É¼ÇÀ» »ç¿ëÇÒ ¶§ Ãâ·Â À̸§À» *.dll·Î ÇØ¾ß ÇÑ´Ù. Ãß°¡·Î ¿ÀºêÁ§Æ® ÆÄÀÏ°ú °°ÀÌ ¸µÄ¿ ¸í·ÉÇà¿¡ »ç¿ëÇÒ ¼ö Àִ ǥÁØ *.def ÆÄÀϵµ Áö¿øÇÑ´Ù. (º¸Åë ¿ÀºêÁ§Æ® ÆÄÀÏ°ú °°ÀÌ ¸µÅ©µÇ·Á¸é ½Éº¼À» ÀͽºÆ÷Æ®ÇÏ´Â ¾ÆÄ«À̺ê Àü¿¡ À§Ä¡ÇØ¾ß ÇÑ´Ù.)

In addition to the options common to all targets, the i386 PE linker support additional command line options that are specific to the i386 PE target. Options that take values may be separated from their values by either a space or an equals sign.

¸ðµç Ç÷¡Æû¿¡ °øÅëÀÎ ¿É¼Ç¿¡ Ãß°¡·Î i386 PE ¸µÄ¿ ƯÀ¯ÀÇ ¿É¼ÇÀÌ ÀÖ´Ù. °ªÀ» ¹Þ´Â ¿É¼ÇÀº °ª°ú °ø¹éÀ̳ª µîÈ£·Î ¿¬°áµÈ´Ù.

--add-stdcall-alias
If given, symbols with a stdcall suffix (@nn) will be exported as-is and also with the suffix stripped.
ÀÌ ¿É¼ÇÀÌ »ç¿ëµÇ¸é stdcall Á¢¹Ì»ç¸¦ (@nn) °¡Áø ½Éº¼Àº ±×´ë·Î ÀͽºÆ÷Æ®µÇ¸ç Á¢¹Ì»ç´Â Á¦°ÅµÈ´Ù.
--base-file file
Use file as the name of a file in which to save the base addresses of all the relocations needed for generating DLLs with `dlltool'.
`dlltool'·Î DLL¸¦ »ý¼ºÇÏÇÒ ¶§ ÆÄÀÏ file¿¡ ÀúÀåµÈ Àç¹èÄ¡ ±âº» ÁÖ¼Ò¸¦ »ç¿ëÇÑ´Ù.
--dll
Create a DLL instead of a regular executable. You may also use -shared or specify a LIBRARY in a given .def file.
º¸Åë ½ÇÇàÆÄÀÏ ´ë½Å¿¡ DLLÀ» »ý¼ºÇÑ´Ù. ÀÌ ¿É¼Ç ´ë½Å¿¡ -shared³ª .def ÆÄÀÏ¿¡¼­ LIBRARY¸¦ ÁöÁ¤Çصµ µÈ´Ù.
--enable-stdcall-fixup
--disable-stdcall-fixup
If the link finds a symbol that it cannot resolve, it will attempt to do "fuzzy linking" by looking for another defined symbol that differs only in the format of the symbol name (cdecl vs stdcall) and will resolve that symbol by linking to the match. For example, the undefined symbol _foo might be linked to the function _foo@12, or the undefined symbol _bar@16 might be linked to the function _bar. When the linker does this, it prints a warning, since it normally should have failed to link, but sometimes import libraries generated from third-party dlls may need this feature to be usable. If you specify --enable-stdcall-fixup, this feature is fully enabled and warnings are not printed. If you specify --disable-stdcall-fixup, this feature is disabled and such mismatches are considered to be errors.
¸µÅ©°¡ ¸®Á¹ºê ÇÒ ¼ö ¾ø´Â ½Éº¼À» ¹ß°ßÇÏ¸é ½Éº¼ À̸§ Çü½Ä¿¡¼­¸¸ (cdecl ´ë stdcall) Â÷ÀÌ°¡ ³ª´Â Á¤ÀÇµÈ ´Ù¸¥ ½Éº¼À» ã¾Æ¼­ ¸µÅ©ÇÏ·Á°í ½ÃµµÇÑ´Ù. ¿¹¸¦ µé¾î Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼ _fooÀº ÇÔ¼ö _foo@12¿¡, Á¤ÀǵÇÁö ¾ÊÀº ½Éº¼ _bar@16´Â ÇÔ¼ö _bar·Î ¸µÅ©µÉ ¼ö ÀÖ´Ù. ÀÌ·± °æ¿ì º¸Åë ¸µÅ©´Â ãÁö¸øÇϱ⠶§¹®¿¡ °æ°í¸¦ Ãâ·ÂÇÑ´Ù. ±×·¯³ª ´Ù¸¥ ȸ»çÀÇ dll·Î »ý¼ºÇÑ ¶óÀ̺귯¸®¸¦ ÀÓÆ÷Æ®ÇÏ´Â °æ¿ì ÀÌ ±â´ÉÀÌ À¯¿ëÇÒ ¼ö ÀÖ´Ù. --enable-stdcall-fixupÀÌ »ç¿ëµÇ¸é ÀÌ ±â´ÉÀÌ ÀÛµ¿ÇÏ°í °æ°í´Â Ãâ·ÂµÇÁö ¾Ê´Â´Ù. --disable-stdcall-fixupÀÌ »ç¿ëµÇ¸é ÀÌ ±â´ÉÀº ÀÛµ¿ÇÏÁö ¾Ê°í, ÀÌ·± ºÒÀÏÄ¡´Â ¿À·ù·Î °£ÁֵȴÙ.
--export-all-symbols
If given, all global symbols in the objects used to build a DLL will be exported by the DLL. Note that this is the default if there otherwise wouldn't be any exported symbols. When symbols are explicitly exported via DEF files or implicitly exported via function attributes, the default is to not export anything else unless this option is given. Note that the symbols DllMain@12, DllEntryPoint@0, and impure_ptr will not be automatically exported.
ÀÌ ¿É¼ÇÀÌ »ç¿ëµÇ¸é DLLÀ» ¸¸µå´Âµ¥ ¾²ÀÎ °´Ã¼ÀÇ ¸ðµç Àü¿ª ½Éº¼ÀÌ DLL¿¡¼­µµ ÀͽºÆ÷Æ®µÈ´Ù. ÁÖÀÇ! ±âº»ÀûÀ¸·Î ¾î¶² ½Éº¼µµ ÀͽºÆ÷Æ®µÇÁö ¾Ê´Â´Ù. ÀÌ ¿É¼ÇÀÌ »ç¿ëµÇÁö ¾Ê´Â´Ù¸é ±âº»ÀûÀ¸·Î DEF ÆÄÀÏ¿¡¼­ ¸í½ÃÀûÀ¸·Î ÀͽºÆ÷Æ®Çϰųª ÇÔ¼ö ¼Ó¼ºÀ¸·Î ¾Ï½ÃÀûÀ¸·Î ÀͽºÆ÷Æ®µÈ ½Éº¼ ¿Ü¿¡´Â ÀͽºÆ÷Æ®µÇÁö ¾Ê´Â´Ù. ÁÖÀÇ! DllMain@12, DllEntryPoint@0, impure_ptr´Â ÀÚµ¿À¸·Î ÀͽºÆ÷Æ®µÇÁö ¾Ê´Â´Ù.
--exclude-symbols symbol,symbol,...
Specifies a list of symbols which should not be automatically exported. The symbol names may be delimited by commas or colons.
ÀÚµ¿À¸·Î ÀͽºÆ÷Æ®µÇ¸é ¾ÈµÇ´Â ½Éº¼ÀÇ ¸ñ·ÏÀ» ÁöÁ¤ÇÑ´Ù. ½Éº¼ À̸§Àº `,'³ª `:'À¸·Î ±¸ºÐµÈ´Ù.
--file-alignment
Specify the file alignment. Sections in the file will always begin at file offsets which are multiples of this number. This defaults to 512.
ÆÄÀÏ Á¤·Ä ¼³Á¤ÇÑ´Ù. ÆÄÀÏÀÇ ¼½¼ÇÀº Ç×»ó ÀÌ ¼öÀÇ ¹è¼ö°¡ µÇ´Â ¿É¼Ç¿¡¼­ ½ÃÀÛÇÑ´Ù. ±âº»°ªÀº 512ÀÌ´Ù.
--heap reserve
--heap reserve,commit
Specify the amount of memory to reserve (and optionally commit) to be used as heap for this program. The default is 1Mb reserved, 4K committed.
ÇÁ·Î±×·¥¿¡¼­ ÈüÀ¸·Î ¿¹¾àµÈ ¸Þ¸ð¸® ¾çÀ» (¶Ç ¼±ÅÃÀûÀ¸·Î ÃʱⰪ) Á¤ÇÑ´Ù. ±âº»À¸·Î ÈüÀ¸·Î ¿¹¾àÇÏ´Â ¸Þ¸ð¸®´Â 1MbÀÌ°í ÃʱⰪÀº 4KÀÌ´Ù.
--image-base value
Use value as the base address of your program or dll. This is the lowest memory location that will be used when your program or dll is loaded. To reduce the need to relocate and improve performance of your dlls, each should have a unique base address and not overlap any other dlls. The default is 0x400000 for executables, and 0x10000000 for dlls.
ÇÁ·Î±×·¥À̳ª dllÀÇ ±âº» ÁÖ¼Ò·Î value¸¦ »ç¿ëÇÑ´Ù. ÀÌ´Â ÇÁ·Î±×·¥À̳ª dllÀ» ÀоîµéÀ̴µ¥ »ç¿ëÇÒ ÃÖ¼Ò ¸Þ¸ð¸® ÁÖ¼ÒÀÌ´Ù. Àç¹èÄ¡ÇÒ Çʿ並 ¾ø¾Ö°í dll ¼º´ÉÀ» Çâ»ó½ÃÅ°·Á¸é ¼­·Î ´Ù¸¥ ±âº» ÁÖ¼Ò¸¦ °¡Áö°í ´Ù¸¥ dll°ú °ãÄ¡¸é ¾ÈµÈ´Ù. ±âº»°ªÀ¸·Î ½ÇÇàÆÄÀÏÀº 0x400000, dllÀº 0x10000000ÀÌ´Ù.
--kill-at
If given, the stdcall suffixes (@nn) will be stripped from symbols before they are exported.
½Éº¼ÀÌ ÀͽºÆ÷Æ®µÇ±â Àü¿¡ stdcall Á¢¹Ì»ç (@nn)´Â Á¦°ÅµÈ´Ù.
--major-image-version value
Sets the major number of the "image version". Defaults to 1.
"image version"ÀÇ major number¸¦ ÁöÁ¤ÇÑ´Ù. ±âº»°ªÀº 1ÀÌ´Ù.
--major-os-version value
Sets the major number of the "os version". Defaults to 4.
"os version"ÀÇ major number¸¦ ÁöÁ¤ÇÑ´Ù. ±âº»°ªÀº 4ÀÌ´Ù.
--major-subsystem-version value
Sets the major number of the "subsystem version". Defaults to 4.
"subsystem version"ÀÇ major number¸¦ ÁöÁ¤ÇÑ´Ù. ±âº»°ªÀº 4ÀÌ´Ù.
--minor-image-version value
Sets the minor number of the "image version". Defaults to 0.
"image version"ÀÇ minor number¸¦ ÁöÁ¤ÇÑ´Ù. ±âº»°ªÀº 0ÀÌ´Ù.
--minor-os-version value
Sets the minor number of the "os version". Defaults to 0.
"os version"ÀÇ minor number¸¦ ÁöÁ¤ÇÑ´Ù. ±âº»°ªÀº 0ÀÌ´Ù.
--minor-subsystem-version value
Sets the minor number of the "subsystem version". Defaults to 0.
"subsystem version"ÀÇ minor number¸¦ ÁöÁ¤ÇÑ´Ù. ±âº»°ªÀº 0ÀÌ´Ù.
--output-def file
The linker will create the file file which will contain a DEF file corresponding to the DLL the linker is generating. This DEF file (which should be called *.def) may be used to create an import library with dlltool or may be used as a reference to automatically or implicitly exported symbols.
¸µÄ¿°¡ »ý¼ºÇÏ´Â DLL¿¡ ÇØ´çÇÏ´Â DEF ÆÄÀÏÀ» ÀúÀåÇÒ ÆÄÀÏ fileÀ» ¸¸µç´Ù. ÀÌ DEF ÆÄÀÏÀº (*.def) dlltool·Î ÀÓÆ÷Æ® ¶óÀ̺귯¸®¸¦ ¸¸µé°Å³ª, ÀÚµ¿ ȤÀº ¾Ï½ÃÀûÀ¸·Î ÀͽºÆ÷Æ®µÈ ½Éº¼À» ÂüÁ¶ÇÒ ¶§ »ç¿ëµÈ´Ù.
--section-alignment
Sets the section alignment. Sections in memory will always begin at addresses which are a multiple of this number. Defaults to 0x1000.
¼½¼Ç Á¤·ÄÀ» ¼³Á¤ÇÑ´Ù. ¸Þ¸ð¸®¿¡ ¼½¼ÇÀº Ç×»ó ÀÌ ¼öÀÇ ¹è¼öÀÎ ÁÖ¼Ò¿¡¼­ ½ÃÀÛÇÑ´Ù. ±âº»°ªÀº 0x1000ÀÌ´Ù.
--stack reserve
--stack reserve,commit
Specify the amount of memory to reserve (and optionally commit) to be used as stack for this program. The default is 32Mb reserved, 4K committed.
ÇÁ·Î±×·¥¿¡¼­ ½ºÅÃÀ¸·Î ¿¹¾àµÈ ¸Þ¸ð¸® ¾çÀ» (¶Ç ¼±ÅÃÀûÀ¸·Î ÃʱⰪ) Á¤ÇÑ´Ù. ±âº»ÀûÀ¸·Î ½ºÅÿ¡ ¿¹¾àµÈ ¸Þ¸ð¸®´Â 32MbÀÌ°í ÃʱⰪÀº 4KÀÌ´Ù.
--subsystem which
--subsystem which:major
--subsystem which:major.minor
Specifies the subsystem under which your program will execute. The legal values for which are native, windows, console, and posix. You may optionally set the subsystem version also.
ÇÁ·Î±×·¥ÀÌ ½ÇÇàµÉ ¼­ºê½Ã½ºÅÛÀ» ÁöÁ¤ÇÑ´Ù. which¿¡ »ç¿ë°¡´ÉÇÑ °ªÀº native, windows, console, posixÀÌ´Ù. ¶ÇÇÑ ¼±ÅÃÀûÀ¸·Î ¼­ºê½Ã½ºÅÛ ¹öÀüÀ» ¼³Á¤ÇÒ ¼öµµ ÀÖ´Ù.

ȯ°æº¯¼ö

You can change the behavior of ld with the environment variables GNUTARGET, LDEMULATION, and COLLECT_NO_DEMANGLE.

ldÀÇ ÇൿÀ» ȯ°æº¯¼ö GNUTARGET, LDEMULATION, COLLECT_NO_DEMANGLE·Î Á¶Á¤ÇÒ ¼ö ÀÖ´Ù.

GNUTARGET determines the input-file object format if you don't use `-b' (or its synonym `--format'). Its value should be one of the BFD names for an input format (see section BFD). If there is no GNUTARGET in the environment, ld uses the natural format of the target. If GNUTARGET is set to default then BFD attempts to discover the input format by examining binary input files; this method often succeeds, but there are potential ambiguities, since there is no method of ensuring that the magic number used to specify object-file formats is unique. However, the configuration procedure for BFD on each system places the conventional format for that system first in the search-list, so ambiguities are resolved in favor of convention.
GNUTARGETÀº `-b' (³ª `--format') ¿É¼ÇÀÌ »ç¿ëµÇÁö ¾ÊÀº °æ¿ì ÀÔ·ÂÆÄÀÏÀÇ Çü½ÄÀ» ÁöÁ¤ÇÑ´Ù. ÀÌ °ªÀº ÀÔ·Â Çü½Ä¿¡ ´ëÇÑ BFD À̸§À̾î¾ß ÇÑ´Ù. (BFD¸¦ ÂüÁ¶Ç϶ó.) ¸¸¾à GNUTARGET ȯ°æº¯¼ö°¡ ¾ø´Ù¸é Ç÷¡ÆûÀÇ ±âº» Çü½ÄÀ» »ç¿ëÇÑ´Ù. GNUTARGET°¡ default·Î ¼³Á¤µÇ¾ú´Ù¸é BFD´Â ÀÔ·ÂÆÄÀÏÀ» »ìÆ캸°í Çü½ÄÀ» ¾Ë¾Æ³»·Á°í ½ÃµµÇÑ´Ù. º¸Åë ÀÌ ¹æ¹ýÀº ¼º°øÇϳª ¸ÅÁ÷³Ñ¹ö°¡ ¿ÀºêÁ§Æ® ÆÄÀÏ Çü½ÄÀ» °áÁ¤ÇÏÁö ¸øÇÏ¿© ¸ðÈ£ÇÒ °æ¿ìµµ ÀÖ´Ù. ±×·¯³ª °¢ ½Ã½ºÅÛ¿¡¼­ BFD¸¦ ¼³Á¤ÇÒ ¶§ ÀÚÁÖ »ç¿ëµÇ´Â Çü½ÄÀ» °Ë»ö ¸ñ·Ï ¾Õ¿¡ À§Ä¡ÇÏ¿© ¸ðÈ£ÇÔÀ» ÇØ°áÇÑ´Ù.

LDEMULATION determines the default emulation if you don't use the `-m' option. The emulation can affect various aspects of linker behaviour, particularly the default linker script. You can list the available emulations with the `--verbose' or `-V' options. If the `-m' option is not used, and the LDEMULATION environment variable is not defined, the default emulation depends upon how the linker was configured.
LDEMULATION´Â `-m' ¿É¼ÇÀÌ »ç¿ëµÇÁö ¾Ê¾ÒÀ» ¶§ ±âº» ¿¡¹Ä·¹À̼ÇÀ» ÁöÁ¤ÇÑ´Ù. ¿¡¹Ä·¹À̼ÇÀº ¸µÄ¿ÀÇ ¿©·¯ Çൿ¿¡, ƯÈ÷ ±âº» ¸µÄ¿ ½ºÅ©¸³Æ®¿¡ ¿µÇâÀ» ÁØ´Ù. »ç¿ë °¡´ÉÇÑ ¿¡¹Ä·¹À̼ÇÀº `--verbose'³ª `-V' ¿É¼ÇÀ¸·Î È®ÀÎÇÒ ¼ö ÀÖ´Ù. `-m' ¿É¼ÇÀ» »ç¿ëÇÏÁö ¾Ê°í ȯ°æº¯¼ö LDEMULATION°¡ ¾ø´Ù¸é ¸µÄ¿°¡ ±¸¼ºµÈ ¹æ¹ý¿¡ µû¶ó ±âº» ¿¡¹Ä·¹À̼ÇÀÌ °áÁ¤µÈ´Ù.

Normally, the linker will default to demangling symbols. However, if COLLECT_NO_DEMANGLE is set in the environment, then it will default to not demangling symbols. This environment variable is used in a similar fashion by the gcc linker wrapper program. The default may be overridden by the `--demangle' and `--no-demangle' options.
º¸Åë ¸µÄ¿´Â ±âº»ÀûÀ¸·Î ½Éº¼À» µð¸Í±Û¸µÇÑ´Ù. ±×·¯³ª ȯ°æº¯¼ö COLLECT_NO_DEMANGLE°¡ ÀÖ´Ù¸é ÀÚµ¿À¸·Î ½Éº¼À» µð¸Í±Û¸µÇÏÁö ¾Ê´Â´Ù. gcc(¸µÄ¿ ·¡ÆÛ ÇÁ·Î±×·¥)µµ ÀÌ È¯°æº¯¼ö¸¦ »ç¿ëÇÑ´Ù. ±âº»°ªÀº `--demangle'³ª `--no-demangle'·Î ¹«½ÃÇÒ ¼ö ÀÖ´Ù.


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