Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/ld/ld.1

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    1 .\" Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
    2 .\" 2001 Free Software Foundation, Inc.
    3 .\" See section COPYING for conditions for redistribution
    4 .TH ld 1 "" "Free Software Foundation" "GNU Development Tools"
    5 .de BP
    6 .sp
    7 .ti \-.2i
    8 \(**
     1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
     2.\"
     3.\" Standard preamble:
     4.\" ========================================================================
     5.de Sh \" Subsection heading
     6.br
     7.if t .Sp
     8.ne 5
     9.PP
     10\fB\\$1\fR
     11.PP
    912..
    10 
    11 .SH NAME
    12 ld \- the GNU linker
    13 
    14 .SH SYNOPSIS
     13.de Sp \" Vertical space (when we can't use .PP)
     14.if t .sp .5v
     15.if n .sp
     16..
     17.de Vb \" Begin verbatim text
     18.ft CW
     19.nf
     20.ne \\$1
     21..
     22.de Ve \" End verbatim text
     23.ft R
     24.fi
     25..
     26.\" Set up some character translations and predefined strings.  \*(-- will
     27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
     28.\" double quote, and \*(R" will give a right double quote.  | will give a
     29.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
     30.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
     31.\" expand to `' in nroff, nothing in troff, for use with C<>.
     32.tr \(*W-|\(bv\*(Tr
     33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
     34.ie n \{\
     35.    ds -- \(*W-
     36.    ds PI pi
     37.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
     38.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
     39.    ds L" ""
     40.    ds R" ""
     41.    ds C` ""
     42.    ds C' ""
     43'br\}
     44.el\{\
     45.    ds -- \|\(em\|
     46.    ds PI \(*p
     47.    ds L" ``
     48.    ds R" ''
     49'br\}
     50.\"
     51.\" If the F register is turned on, we'll generate index entries on stderr for
     52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
     53.\" entries marked with X<> in POD.  Of course, you'll have to process the
     54.\" output yourself in some meaningful fashion.
     55.if \nF \{\
     56.    de IX
     57.    tm Index:\\$1\t\\n%\t"\\$2"
     58..
     59.    nr % 0
     60.    rr F
     61.\}
     62.\"
     63.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
     64.\" way too many mistakes in technical documents.
    1565.hy 0
    16 .na
    17 .TP
    18 .B ld
    19 .RB "[\|" \-o "
    20 .I output\c
    21 \&\|] \c
    22 .I objfile\c
    23 \&.\|.\|.
    24 .br
    25 .RB "[\|" \-A\c
    26 .I architecture\c
    27 \&\|]
    28 .RB "[\|" "\-b\ "\c
    29 .I input-format\c
    30 \&\|]
    31 .RB "[\|" \-Bstatic "\|]" 
    32 .RB "[\|" \-Bgroup "\|]" 
    33 .RB "[\|" \-Bdynamic "\|]" 
    34 .RB "[\|" \-Bsymbolic "\|]" 
    35 .RB "[\|" "\-c\ "\c
    36 .I commandfile\c
    37 \&\|]
    38 .RB "[\|" \-\-cref "\|]"
    39 .RB "[\|" \-d | \-dc | \-dp\c
    40 \|]
    41 .br
    42 .RB "[\|" "\-defsym\ "\c
    43 .I symbol\c
    44 \&=\c
    45 .I expression\c
    46 \&\|]
    47 .RB "[\|" \-\-demangle "\|]"
    48 .RB "[\|" \-\-no\-demangle "\|]"
    49 .RB "[\|" "\-e\ "\c
    50 .I entry\c
    51 \&\|]
    52 .RB "[\|" \-embedded\-relocs "\|]"
    53 .RB "[\|" \-E "\|]"
    54 .RB "[\|" \-export\-dynamic "\|]"
    55 .RB "[\|" "\-f\ "\c
    56 .I name\c
    57 \&\|]
    58 .RB "[\|" "\-\-auxiliary\ "\c
    59 .I name\c
    60 \&\|]
    61 .RB "[\|" "\-F\ "\c
    62 .I name\c
    63 \&\|]
    64 .RB "[\|" "\-\-filter\ "\c
    65 .I name\c
    66 \&\|]
    67 .RB "[\|" "\-format\ "\c
    68 .I input-format\c
    69 \&\|]
    70 .RB "[\|" \-g "\|]"
    71 .RB "[\|" \-G
    72 .I size\c
    73 \&\|]
    74 .RB "[\|" "\-h\ "\c
    75 .I name\c
    76 \&\|]
    77 .RB "[\|" "\-soname\ "\c
    78 .I name\c
    79 \&\|]
    80 .RB "[\|" \-\-help "\|]"
    81 .RB "[\|" \-i "\|]"
    82 .RB "[\|" \-l\c
    83 .I ar\c
    84 \&\|]
    85 .RB "[\|" \-L\c
    86 .I searchdir\c
    87 \&\|]
    88 .RB "[\|" \-M "\|]"
    89 .RB "[\|" \-Map
    90 .I mapfile\c
    91 \&\|]
    92 .RB "[\|" \-m
    93 .I emulation\c
    94 \&\|]
    95 .RB "[\|" \-n | \-N "\|]"
    96 .RB "[\|" \-noinhibit-exec "\|]"
    97 .RB "[\|" \-no\-keep\-memory "\|]"
    98 .RB "[\|" \-no\-warn\-mismatch "\|]"
    99 .RB "[\|" \-O\c
    100 .I level\c
    101 \&\|]
    102 .RB "[\|" "\--oformat\ "\c
    103 .I output-format\c
    104 \&\|]
    105 .RB "[\|" "\-R\ "\c
    106 .I filename\c
    107 \&\|]
    108 .RB "[\|" \-relax "\|]"
    109 .RB "[\|" \-r | \-Ur "\|]"
    110 .RB "[\|" "\-rpath\ "\c
    111 .I directory\c
    112 \&\|]
    113 .RB "[\|" "\-rpath\-link\ "\c
    114 .I directory\c
    115 \&\|]
    116 .RB "[\|" \-S "\|]"
    117 .RB "[\|" \-s "\|]"
    118 .RB "[\|" \-shared "\|]"
    119 .RB "[\|" \-sort\-common "\|]"
    120 .RB "[\|" "\-split\-by\-reloc\ "\c
    121 .I count\c
    122 \&\|]
    123 .RB "[\|" \-split\-by\-file "\|]"
    124 .RB "[\|" "\-T\ "\c
    125 .I commandfile\c
    126 \&\|] 
    127 .RB "[\|" "\-\-section\-start\ "\c
    128 .I sectionname\c
    129 \&=\c
    130 .I sectionorg\c
    131 \&\|]
    132 .RB "[\|" "\-Ttext\ "\c
    133 .I textorg\c
    134 \&\|]
    135 .RB "[\|" "\-Tdata\ "\c
    136 .I dataorg\c
    137 \&\|]
    138 .RB "[\|" "\-Tbss\ "\c
    139 .I bssorg\c
    140 \&\|]
    141 .RB "[\|" \-t "\|]"
    142 .RB "[\|" "\-u\ "\c
    143 .I sym\c
    144 \&]
    145 .RB "[\|" \-V "\|]"
    146 .RB "[\|" \-v "\|]"
    147 .RB "[\|" \-\-verbose "\|]"
    148 .RB "[\|" \-\-version "\|]"
    149 .RB "[\|" \-warn\-common "\|]"
    150 .RB "[\|" \-warn\-constructors "\|]"
    151 .RB "[\|" \-warn\-multiple\-gp "\|]"
    152 .RB "[\|" \-warn\-once "\|]"
    153 .RB "[\|" \-warn\-section\-align "\|]"
    154 .RB "[\|" \-\-whole\-archive "\|]"
    155 .RB "[\|" \-\-no\-whole\-archive "\|]"
    156 .RB "[\|" "\-\-wrap\ "\c
    157 .I symbol\c
    158 \&\|]
    159 .RB "[\|" \-X "\|]"
    160 .RB "[\|" \-x "\|]"
    161 .ad b
    162 .hy 1
    163 .SH DESCRIPTION
    164 \c
    165 .B ld\c
    166 \& combines a number of object and archive files, relocates
    167 their data and ties up symbol references. Often the last step in
    168 building a new compiled program to run is a call to \c
    169 .B ld\c
    170 \&.
    171 
    172 \c
    173 .B ld\c
    174 \& accepts Linker Command Language files
     66.\"
     67.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
     68.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
     69.    \" fudge factors for nroff and troff
     70.if n \{\
     71.    ds #H 0
     72.    ds #V .8m
     73.    ds #F .3m
     74.    ds #[ \f1
     75.    ds #] \fP
     76.\}
     77.if t \{\
     78.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
     79.    ds #V .6m
     80.    ds #F 0
     81.    ds #[ \&
     82.    ds #] \&
     83.\}
     84.    \" simple accents for nroff and troff
     85.if n \{\
     86.    ds ' \&
     87.    ds ` \&
     88.    ds ^ \&
     89.    ds , \&
     90.    ds ~ ~
     91.    ds /
     92.\}
     93.if t \{\
     94.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
     95.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
     96.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
     97.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
     98.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
     99.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
     100.\}
     101.    \" troff and (daisy-wheel) nroff accents
     102.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
     103.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
     104.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
     105.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
     106.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
     107.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
     108.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
     109.ds ae a\h'-(\w'a'u*4/10)'e
     110.ds Ae A\h'-(\w'A'u*4/10)'E
     111.    \" corrections for vroff
     112.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
     113.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
     114.    \" for low resolution devices (crt and lpr)
     115.if \n(.H>23 .if \n(.V>19 \
     116\{\
     117.    ds : e
     118.    ds 8 ss
     119.    ds o a
     120.    ds d- d\h'-1'\(ga
     121.    ds D- D\h'-1'\(hy
     122.    ds th \o'bp'
     123.    ds Th \o'LP'
     124.    ds ae ae
     125.    ds Ae AE
     126.\}
     127.rm #[ #] #H #V #F C
     128.\" ========================================================================
     129.\"
     130.IX Title "LD 1"
     131.TH LD 1 "2003-06-12" "binutils-2.14" "GNU Development Tools"
     132.SH "NAME"
     133ld \- Using LD, the GNU linker
     134.SH "SYNOPSIS"
     135.IX Header "SYNOPSIS"
     136ld [\fBoptions\fR] \fIobjfile\fR ...
     137.SH "DESCRIPTION"
     138.IX Header "DESCRIPTION"
     139\&\fBld\fR combines a number of object and archive files, relocates
     140their data and ties up symbol references. Usually the last step in
     141compiling a program is to run \fBld\fR.
     142.PP
     143\&\fBld\fR accepts Linker Command Language files written in
     144a superset of \s-1AT&T\s0's Link Editor Command Language syntax,
    175145to provide explicit and total control over the linking process.
    176 This man page does not describe the command language; see the `\|\c
    177 .B ld\c
    178 \|' entry in `\|\c
    179 .B info\c
    180 \|', or the manual
    181 .I
    182 ld: the GNU linker
    183 \&, for full details on the command language and on other aspects of
    184 the GNU linker.
    185 
    186 This version of \c
    187 .B ld\c
    188 \& uses the general purpose BFD libraries
    189 to operate on object files. This allows \c
    190 .B ld\c
    191 \& to read, combine, and
    192 write object files in many different formats\(em\&for example, COFF or
    193 \c
    194 .B a.out\c
    195 \&.  Different formats may be linked together to produce any
    196 available kind of object file.  You can use `\|\c
    197 .B objdump \-i\c
    198 \|' to get a list of formats supported on various architectures; see
    199 .BR objdump ( 1 ).
    200 
    201 Aside from its flexibility, the GNU linker is more helpful than other
     146.PP
     147This man page does not describe the command language; see the
     148\&\fBld\fR entry in \f(CW\*(C`info\*(C'\fR, or the manual
     149ld: the \s-1GNU\s0 linker, for full details on the command language and
     150on other aspects of the \s-1GNU\s0 linker.
     151.PP
     152This version of \fBld\fR uses the general purpose \s-1BFD\s0 libraries
     153to operate on object files. This allows \fBld\fR to read, combine, and
     154write object files in many different formats\-\-\-for example, \s-1COFF\s0 or
     155\&\f(CW\*(C`a.out\*(C'\fR.  Different formats may be linked together to produce any
     156available kind of object file. 
     157.PP
     158Aside from its flexibility, the \s-1GNU\s0 linker is more helpful than other
    202159linkers in providing diagnostic information.  Many linkers abandon
    203160execution immediately upon encountering an error; whenever possible,
    204 \c
    205 .B ld\c
    206 \& continues executing, allowing you to identify other errors
     161\&\fBld\fR continues executing, allowing you to identify other errors
    207162(or, in some cases, to get an output file in spite of the error).
    208 
    209 The GNU linker \c
    210 .B ld\c
    211 \& is meant to cover a broad range of situations,
     163.PP
     164The \s-1GNU\s0 linker \fBld\fR is meant to cover a broad range of situations,
    212165and to be as compatible as possible with other linkers.  As a result,
    213 you have many choices to control its behavior through the command line,
    214 and through environment variables.
    215 
    216 .SH OPTIONS
    217 The plethora of command-line options may seem intimidating, but in
    218 actual practice few of them are used in any particular context.
    219 For instance, a frequent use of \c
    220 .B ld\c
    221 \& is to link standard Unix
     166you have many choices to control its behavior.
     167.SH "OPTIONS"
     168.IX Header "OPTIONS"
     169The linker supports a plethora of command-line options, but in actual
     170practice few of them are used in any particular context.
     171For instance, a frequent use of \fBld\fR is to link standard Unix
    222172object files on a standard, supported Unix system.  On such a system, to
    223 link a file \c
    224 .B hello.o\c
    225 \&:
    226 .sp
    227 .br
    228 $\ ld\ \-o\ output\ /lib/crt0.o\ hello.o\ \-lc
    229 .br
    230 .sp
    231 This tells \c
    232 .B ld\c
    233 \& to produce a file called \c
    234 .B output\c
    235 \& as the
    236 result of linking the file \c
    237 .B /lib/crt0.o\c
    238 \& with \c
    239 .B hello.o\c
    240 \& and
    241 the library \c
    242 .B libc.a\c
    243 \& which will come from the standard search
    244 directories.
    245 
    246 The command-line options to \c
    247 .B ld\c
    248 \& may be specified in any order, and
    249 may be repeated at will.  For the most part, repeating an option with a
     173link a file \f(CW\*(C`hello.o\*(C'\fR:
     174.PP
     175.Vb 1
     176\&        ld -o <output> /lib/crt0.o hello.o -lc
     177.Ve
     178.PP
     179This tells \fBld\fR to produce a file called \fIoutput\fR as the
     180result of linking the file \f(CW\*(C`/lib/crt0.o\*(C'\fR with \f(CW\*(C`hello.o\*(C'\fR and
     181the library \f(CW\*(C`libc.a\*(C'\fR, which will come from the standard search
     182directories.  (See the discussion of the \fB\-l\fR option below.)
     183.PP
     184Some of the command-line options to \fBld\fR may be specified at any
     185point in the command line.  However, options which refer to files, such
     186as \fB\-l\fR or \fB\-T\fR, cause the file to be read at the point at
     187which the option appears in the command line, relative to the object
     188files and other file options.  Repeating non-file options with a
    250189different argument will either have no further effect, or override prior
    251 occurrences (those further to the left on the command line) of an
    252 option. 
    253 
    254 The exceptions\(em\&which may meaningfully be used more than once\(em\&are
    255 \c
    256 .B \-A\c
    257 \&, \c
    258 .B \-b\c
    259 \& (or its synonym \c
    260 .B \-format\c
    261 \&), \c
    262 .B \-defsym\c
    263 \&, \c
    264 .B \-\-section\-start\c
    265 \&, \c
    266 .B \-L\c
    267 \&, \c
    268 .B \-l\c
    269 \&, \c
    270 .B \-R\c
    271 \&, and \c
    272 .B \-u\c
    273 \&.
    274 
    275 The list of object files to be linked together, shown as \c
    276 .I objfile\c
    277 \&,
    278 may follow, precede, or be mixed in with command-line options; save that
    279 an \c
    280 .I objfile\c
    281 \& argument may not be placed between an option flag and
    282 its argument.
    283 
    284 Usually the linker is invoked with at least one object file, but other
    285 forms of binary input files can also be specified with \c
    286 .B \-l\c
    287 \&,
    288 \c
    289 .B \-R\c
    290 \&, and the script command language.  If \c
    291 .I no\c
    292 \& binary input
    293 files at all are specified, the linker does not produce any output, and
    294 issues the message `\|\c
    295 .B No input files\c
    296 \|'.
    297 
    298 Option arguments must either follow the option letter without intervening
     190occurrences (those further to the left on the command line) of that
     191option.  Options which may be meaningfully specified more than once are
     192noted in the descriptions below.
     193.PP
     194Non-option arguments are object files or archives which are to be linked
     195together.  They may follow, precede, or be mixed in with command-line
     196options, except that an object file argument may not be placed between
     197an option and its argument.
     198.PP
     199Usually the linker is invoked with at least one object file, but you can
     200specify other forms of binary input files using \fB\-l\fR, \fB\-R\fR,
     201and the script command language.  If \fIno\fR binary input files at all
     202are specified, the linker does not produce any output, and issues the
     203message \fBNo input files\fR.
     204.PP
     205If the linker cannot recognize the format of an object file, it will
     206assume that it is a linker script.  A script specified in this way
     207augments the main linker script used for the link (either the default
     208linker script or the one specified by using \fB\-T\fR).  This feature
     209permits the linker to link against a file which appears to be an object
     210or an archive, but actually merely defines some symbol values, or uses
     211\&\f(CW\*(C`INPUT\*(C'\fR or \f(CW\*(C`GROUP\*(C'\fR to load other objects.  Note that
     212specifying a script in this way merely augments the main linker script;
     213use the \fB\-T\fR option to replace the default linker script entirely.
     214.PP
     215For options whose names are a single letter,
     216option arguments must either follow the option letter without intervening
    299217whitespace, or be given as separate arguments immediately following the
    300218option that requires them.
    301 
    302 .TP
    303 .BI "-A" "architecture"
    304 In the current release of \c
    305 .B ld\c
    306 \&, this option is useful only for the
    307 Intel 960 family of architectures.  In that \c
    308 .B ld\c
    309 \& configuration, the
    310 \c
    311 .I architecture\c
    312 \& argument is one of the two-letter names identifying
    313 members of the 960 family; the option specifies the desired output
    314 target, and warns of any incompatible instructions in the input files.
    315 It also modifies the linker's search strategy for archive libraries, to
    316 support the use of libraries specific to each particular
    317 architecture, by including in the search loop names suffixed with the
    318 string identifying the architecture.
    319 
    320 For example, if your \c
    321 .B ld\c
    322 \& command line included `\|\c
    323 .B \-ACA\c
    324 \|' as
    325 well as `\|\c
    326 .B \-ltry\c
    327 \|', the linker would look (in its built-in search
    328 paths, and in any paths you specify with \c
    329 .B \-L\c
    330 \&) for a library with
    331 the names
    332 .sp
    333 .br
    334 try
    335 .br
    336 libtry.a
    337 .br
    338 tryca
    339 .br
    340 libtryca.a
    341 .br
    342 .sp
    343 
    344 The first two possibilities would be considered in any event; the last
    345 two are due to the use of `\|\c
    346 .B \-ACA\c
    347 \|'.
    348 
    349 Future releases of \c
    350 .B ld\c
    351 \& may support similar functionality for
     219.PP
     220For options whose names are multiple letters, either one dash or two can
     221precede the option name; for example, \fB\-trace\-symbol\fR and
     222\&\fB\-\-trace\-symbol\fR are equivalent.  Note\-\-\-there is one exception to
     223this rule.  Multiple letter options that start with a lower case 'o' can
     224only be preceeded by two dashes.  This is to reduce confusion with the
     225\&\fB\-o\fR option.  So for example \fB\-omagic\fR sets the output file
     226name to \fBmagic\fR whereas \fB\-\-omagic\fR sets the \s-1NMAGIC\s0 flag on the
     227output.
     228.PP
     229Arguments to multiple-letter options must either be separated from the
     230option name by an equals sign, or be given as separate arguments
     231immediately following the option that requires them.  For example,
     232\&\fB\-\-trace\-symbol foo\fR and \fB\-\-trace\-symbol=foo\fR are equivalent.
     233Unique abbreviations of the names of multiple-letter options are
     234accepted.
     235.PP
     236Note\-\-\-if the linker is being invoked indirectly, via a compiler driver
     237(e.g. \fBgcc\fR) then all the linker command line options should be
     238prefixed by \fB\-Wl,\fR (or whatever is appropriate for the particular
     239compiler driver) like this:
     240.PP
     241.Vb 1
     242\&          gcc -Wl,--startgroup foo.o bar.o -Wl,--endgroup
     243.Ve
     244.PP
     245This is important, because otherwise the compiler driver program may
     246silently drop the linker options, resulting in a bad link.
     247.PP
     248Here is a table of the generic command line switches accepted by the \s-1GNU\s0
     249linker:
     250.IP "\fB\-a\fR\fIkeyword\fR" 4
     251.IX Item "-akeyword"
     252This option is supported for \s-1HP/UX\s0 compatibility.  The \fIkeyword\fR
     253argument must be one of the strings \fBarchive\fR, \fBshared\fR, or
     254\&\fBdefault\fR.  \fB\-aarchive\fR is functionally equivalent to
     255\&\fB\-Bstatic\fR, and the other two keywords are functionally equivalent
     256to \fB\-Bdynamic\fR.  This option may be used any number of times.
     257.IP "\fB\-A\fR\fIarchitecture\fR" 4
     258.IX Item "-Aarchitecture"
     259.PD 0
     260.IP "\fB\-\-architecture=\fR\fIarchitecture\fR" 4
     261.IX Item "--architecture=architecture"
     262.PD
     263In the current release of \fBld\fR, this option is useful only for the
     264Intel 960 family of architectures.  In that \fBld\fR configuration, the
     265\&\fIarchitecture\fR argument identifies the particular architecture in
     266the 960 family, enabling some safeguards and modifying the
     267archive-library search path. 
     268.Sp
     269Future releases of \fBld\fR may support similar functionality for
    352270other architecture families.
    353 
    354 You can meaningfully use \c
    355 .B \-A\c
    356 \& more than once on a command line, if
    357 an architecture family allows combination of target architectures; each
    358 use will add another pair of name variants to search for when \c
    359 .B \-l
    360 specifies a library.
    361 
    362 .TP
    363 .BI "\-b " "input-format"
    364 Specify the binary format for input object files that follow this option
    365 on the command line.  You don't usually need to specify this, as
    366 \c
    367 .B ld\c
    368 \& is configured to expect as a default input format the most
    369 usual format on each machine.  \c
    370 .I input-format\c
    371 \& is a text string, the
    372 name of a particular format supported by the BFD libraries. 
    373 \c
    374 .B \-format \c
    375 .I input-format\c
    376 \&\c
    377 \& has the same effect, as does the script command
    378 .BR TARGET .
    379 
     271.IP "\fB\-b\fR \fIinput-format\fR" 4
     272.IX Item "-b input-format"
     273.PD 0
     274.IP "\fB\-\-format=\fR\fIinput-format\fR" 4
     275.IX Item "--format=input-format"
     276.PD
     277\&\fBld\fR may be configured to support more than one kind of object
     278file.  If your \fBld\fR is configured this way, you can use the
     279\&\fB\-b\fR option to specify the binary format for input object files
     280that follow this option on the command line.  Even when \fBld\fR is
     281configured to support alternative object formats, you don't usually need
     282to specify this, as \fBld\fR should be configured to expect as a
     283default input format the most usual format on each machine.
     284\&\fIinput-format\fR is a text string, the name of a particular format
     285supported by the \s-1BFD\s0 libraries.  (You can list the available binary
     286formats with \fBobjdump \-i\fR.)
     287.Sp
    380288You may want to use this option if you are linking files with an unusual
    381 binary format.  You can also use \c
    382 .B \-b\c
    383 \& to switch formats explicitly (when
     289binary format.  You can also use \fB\-b\fR to switch formats explicitly (when
    384290linking object files of different formats), by including
    385 \c
    386 .B \-b \c
    387 .I input-format\c
    388 \&\c
    389 \& before each group of object files in a
    390 particular format. 
    391 
     291\&\fB\-b\fR \fIinput-format\fR before each group of object files in a
     292particular format.
     293.Sp
    392294The default format is taken from the environment variable
    393 .B GNUTARGET\c
    394 \&.  You can also define the input
    395 format from a script, using the command \c
    396 .B TARGET\c
    397 \&.
    398 
    399 .TP
    400 .B \-Bstatic
    401 Do not link against shared libraries.  This is only meaningful on
    402 platforms for which shared libraries are supported.
    403 
    404 .TP
    405 .B \-Bdynamic
     295\&\f(CW\*(C`GNUTARGET\*(C'\fR.
     296.Sp
     297You can also define the input format from a script, using the command
     298\&\f(CW\*(C`TARGET\*(C'\fR;
     299.IP "\fB\-c\fR \fIMRI-commandfile\fR" 4
     300.IX Item "-c MRI-commandfile"
     301.PD 0
     302.IP "\fB\-\-mri\-script=\fR\fIMRI-commandfile\fR" 4
     303.IX Item "--mri-script=MRI-commandfile"
     304.PD
     305For compatibility with linkers produced by \s-1MRI\s0, \fBld\fR accepts script
     306files written in an alternate, restricted command language, described in
     307the \s-1MRI\s0 Compatible Script Files section of \s-1GNU\s0 ld documentation.
     308Introduce \s-1MRI\s0 script files with
     309the option \fB\-c\fR; use the \fB\-T\fR option to run linker
     310scripts written in the general-purpose \fBld\fR scripting language.
     311If \fIMRI-cmdfile\fR does not exist, \fBld\fR looks for it in the directories
     312specified by any \fB\-L\fR options.
     313.IP "\fB\-d\fR" 4
     314.IX Item "-d"
     315.PD 0
     316.IP "\fB\-dc\fR" 4
     317.IX Item "-dc"
     318.IP "\fB\-dp\fR" 4
     319.IX Item "-dp"
     320.PD
     321These three options are equivalent; multiple forms are supported for
     322compatibility with other linkers.  They assign space to common symbols
     323even if a relocatable output file is specified (with \fB\-r\fR).  The
     324script command \f(CW\*(C`FORCE_COMMON_ALLOCATION\*(C'\fR has the same effect.
     325.IP "\fB\-e\fR \fIentry\fR" 4
     326.IX Item "-e entry"
     327.PD 0
     328.IP "\fB\-\-entry=\fR\fIentry\fR" 4
     329.IX Item "--entry=entry"
     330.PD
     331Use \fIentry\fR as the explicit symbol for beginning execution of your
     332program, rather than the default entry point.  If there is no symbol
     333named \fIentry\fR, the linker will try to parse \fIentry\fR as a number,
     334and use that as the entry address (the number will be interpreted in
     335base 10; you may use a leading \fB0x\fR for base 16, or a leading
     336\&\fB0\fR for base 8). 
     337.IP "\fB\-E\fR" 4
     338.IX Item "-E"
     339.PD 0
     340.IP "\fB\-\-export\-dynamic\fR" 4
     341.IX Item "--export-dynamic"
     342.PD
     343When creating a dynamically linked executable, add all symbols to the
     344dynamic symbol table.  The dynamic symbol table is the set of symbols
     345which are visible from dynamic objects at run time.
     346.Sp
     347If you do not use this option, the dynamic symbol table will normally
     348contain only those symbols which are referenced by some dynamic object
     349mentioned in the link.
     350.Sp
     351If you use \f(CW\*(C`dlopen\*(C'\fR to load a dynamic object which needs to refer
     352back to the symbols defined by the program, rather than some other
     353dynamic object, then you will probably need to use this option when
     354linking the program itself.
     355.Sp
     356You can also use the version script to control what symbols should
     357be added to the dynamic symbol table if the output format supports it.
     358See the description of \fB\-\-version\-script\fR in \f(CW@ref\fR{\s-1VERSION\s0}.
     359.IP "\fB\-EB\fR" 4
     360.IX Item "-EB"
     361Link big-endian objects.  This affects the default output format.
     362.IP "\fB\-EL\fR" 4
     363.IX Item "-EL"
     364Link little-endian objects.  This affects the default output format.
     365.IP "\fB\-f\fR" 4
     366.IX Item "-f"
     367.PD 0
     368.IP "\fB\-\-auxiliary\fR \fIname\fR" 4
     369.IX Item "--auxiliary name"
     370.PD
     371When creating an \s-1ELF\s0 shared object, set the internal \s-1DT_AUXILIARY\s0 field
     372to the specified name.  This tells the dynamic linker that the symbol
     373table of the shared object should be used as an auxiliary filter on the
     374symbol table of the shared object \fIname\fR.
     375.Sp
     376If you later link a program against this filter object, then, when you
     377run the program, the dynamic linker will see the \s-1DT_AUXILIARY\s0 field.  If
     378the dynamic linker resolves any symbols from the filter object, it will
     379first check whether there is a definition in the shared object
     380\&\fIname\fR.  If there is one, it will be used instead of the definition
     381in the filter object.  The shared object \fIname\fR need not exist.
     382Thus the shared object \fIname\fR may be used to provide an alternative
     383implementation of certain functions, perhaps for debugging or for
     384machine specific performance.
     385.Sp
     386This option may be specified more than once.  The \s-1DT_AUXILIARY\s0 entries
     387will be created in the order in which they appear on the command line.
     388.IP "\fB\-F\fR \fIname\fR" 4
     389.IX Item "-F name"
     390.PD 0
     391.IP "\fB\-\-filter\fR \fIname\fR" 4
     392.IX Item "--filter name"
     393.PD
     394When creating an \s-1ELF\s0 shared object, set the internal \s-1DT_FILTER\s0 field to
     395the specified name.  This tells the dynamic linker that the symbol table
     396of the shared object which is being created should be used as a filter
     397on the symbol table of the shared object \fIname\fR.
     398.Sp
     399If you later link a program against this filter object, then, when you
     400run the program, the dynamic linker will see the \s-1DT_FILTER\s0 field.  The
     401dynamic linker will resolve symbols according to the symbol table of the
     402filter object as usual, but it will actually link to the definitions
     403found in the shared object \fIname\fR.  Thus the filter object can be
     404used to select a subset of the symbols provided by the object
     405\&\fIname\fR.
     406.Sp
     407Some older linkers used the \fB\-F\fR option throughout a compilation
     408toolchain for specifying object-file format for both input and output
     409object files.
     410The \s-1GNU\s0 linker uses other mechanisms for this purpose: the
     411\&\fB\-b\fR, \fB\-\-format\fR, \fB\-\-oformat\fR options, the
     412\&\f(CW\*(C`TARGET\*(C'\fR command in linker scripts, and the \f(CW\*(C`GNUTARGET\*(C'\fR
     413environment variable.
     414The \s-1GNU\s0 linker will ignore the \fB\-F\fR option when not
     415creating an \s-1ELF\s0 shared object.
     416.IP "\fB\-fini\fR \fIname\fR" 4
     417.IX Item "-fini name"
     418When creating an \s-1ELF\s0 executable or shared object, call \s-1NAME\s0 when the
     419executable or shared object is unloaded, by setting \s-1DT_FINI\s0 to the
     420address of the function.  By default, the linker uses \f(CW\*(C`_fini\*(C'\fR as
     421the function to call.
     422.IP "\fB\-g\fR" 4
     423.IX Item "-g"
     424Ignored.  Provided for compatibility with other tools.
     425.IP "\fB\-G\fR\fIvalue\fR" 4
     426.IX Item "-Gvalue"
     427.PD 0
     428.IP "\fB\-\-gpsize=\fR\fIvalue\fR" 4
     429.IX Item "--gpsize=value"
     430.PD
     431Set the maximum size of objects to be optimized using the \s-1GP\s0 register to
     432\&\fIsize\fR.  This is only meaningful for object file formats such as
     433\&\s-1MIPS\s0 \s-1ECOFF\s0 which supports putting large and small objects into different
     434sections.  This is ignored for other object file formats.
     435.IP "\fB\-h\fR\fIname\fR" 4
     436.IX Item "-hname"
     437.PD 0
     438.IP "\fB\-soname=\fR\fIname\fR" 4
     439.IX Item "-soname=name"
     440.PD
     441When creating an \s-1ELF\s0 shared object, set the internal \s-1DT_SONAME\s0 field to
     442the specified name.  When an executable is linked with a shared object
     443which has a \s-1DT_SONAME\s0 field, then when the executable is run the dynamic
     444linker will attempt to load the shared object specified by the \s-1DT_SONAME\s0
     445field rather than the using the file name given to the linker.
     446.IP "\fB\-i\fR" 4
     447.IX Item "-i"
     448Perform an incremental link (same as option \fB\-r\fR).
     449.IP "\fB\-init\fR \fIname\fR" 4
     450.IX Item "-init name"
     451When creating an \s-1ELF\s0 executable or shared object, call \s-1NAME\s0 when the
     452executable or shared object is loaded, by setting \s-1DT_INIT\s0 to the address
     453of the function.  By default, the linker uses \f(CW\*(C`_init\*(C'\fR as the
     454function to call.
     455.IP "\fB\-l\fR\fIarchive\fR" 4
     456.IX Item "-larchive"
     457.PD 0
     458.IP "\fB\-\-library=\fR\fIarchive\fR" 4
     459.IX Item "--library=archive"
     460.PD
     461Add archive file \fIarchive\fR to the list of files to link.  This
     462option may be used any number of times.  \fBld\fR will search its
     463path-list for occurrences of \f(CW\*(C`lib\f(CIarchive\f(CW.a\*(C'\fR for every
     464\&\fIarchive\fR specified.
     465.Sp
     466On systems which support shared libraries, \fBld\fR may also search for
     467libraries with extensions other than \f(CW\*(C`.a\*(C'\fR.  Specifically, on \s-1ELF\s0
     468and SunOS systems, \fBld\fR will search a directory for a library with
     469an extension of \f(CW\*(C`.so\*(C'\fR before searching for one with an extension of
     470\&\f(CW\*(C`.a\*(C'\fR.  By convention, a \f(CW\*(C`.so\*(C'\fR extension indicates a shared
     471library.
     472.Sp
     473The linker will search an archive only once, at the location where it is
     474specified on the command line.  If the archive defines a symbol which
     475was undefined in some object which appeared before the archive on the
     476command line, the linker will include the appropriate file(s) from the
     477archive.  However, an undefined symbol in an object appearing later on
     478the command line will not cause the linker to search the archive again.
     479.Sp
     480See the \fB\-(\fR option for a way to force the linker to search
     481archives multiple times.
     482.Sp
     483You may list the same archive multiple times on the command line.
     484.Sp
     485This type of archive searching is standard for Unix linkers.  However,
     486if you are using \fBld\fR on \s-1AIX\s0, note that it is different from the
     487behaviour of the \s-1AIX\s0 linker.
     488.IP "\fB\-L\fR\fIsearchdir\fR" 4
     489.IX Item "-Lsearchdir"
     490.PD 0
     491.IP "\fB\-\-library\-path=\fR\fIsearchdir\fR" 4
     492.IX Item "--library-path=searchdir"
     493.PD
     494Add path \fIsearchdir\fR to the list of paths that \fBld\fR will search
     495for archive libraries and \fBld\fR control scripts.  You may use this
     496option any number of times.  The directories are searched in the order
     497in which they are specified on the command line.  Directories specified
     498on the command line are searched before the default directories.  All
     499\&\fB\-L\fR options apply to all \fB\-l\fR options, regardless of the
     500order in which the options appear.
     501.Sp
     502If \fIsearchdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
     503by the \fIsysroot prefix\fR, a path specified when the linker is configured.
     504.Sp
     505The default set of paths searched (without being specified with
     506\&\fB\-L\fR) depends on which emulation mode \fBld\fR is using, and in
     507some cases also on how it was configured. 
     508.Sp
     509The paths can also be specified in a link script with the
     510\&\f(CW\*(C`SEARCH_DIR\*(C'\fR command.  Directories specified this way are searched
     511at the point in which the linker script appears in the command line.
     512.IP "\fB\-m\fR\fIemulation\fR" 4
     513.IX Item "-memulation"
     514Emulate the \fIemulation\fR linker.  You can list the available
     515emulations with the \fB\-\-verbose\fR or \fB\-V\fR options.
     516.Sp
     517If the \fB\-m\fR option is not used, the emulation is taken from the
     518\&\f(CW\*(C`LDEMULATION\*(C'\fR environment variable, if that is defined.
     519.Sp
     520Otherwise, the default emulation depends upon how the linker was
     521configured.
     522.IP "\fB\-M\fR" 4
     523.IX Item "-M"
     524.PD 0
     525.IP "\fB\-\-print\-map\fR" 4
     526.IX Item "--print-map"
     527.PD
     528Print a link map to the standard output.  A link map provides
     529information about the link, including the following:
     530.RS 4
     531.IP "\(bu" 4
     532Where object files and symbols are mapped into memory.
     533.IP "\(bu" 4
     534How common symbols are allocated.
     535.IP "\(bu" 4
     536All archive members included in the link, with a mention of the symbol
     537which caused the archive member to be brought in.
     538.RE
     539.RS 4
     540.RE
     541.IP "\fB\-n\fR" 4
     542.IX Item "-n"
     543.PD 0
     544.IP "\fB\-\-nmagic\fR" 4
     545.IX Item "--nmagic"
     546.PD
     547Turn off page alignment of sections, and mark the output as
     548\&\f(CW\*(C`NMAGIC\*(C'\fR if possible.
     549.IP "\fB\-N\fR" 4
     550.IX Item "-N"
     551.PD 0
     552.IP "\fB\-\-omagic\fR" 4
     553.IX Item "--omagic"
     554.PD
     555Set the text and data sections to be readable and writable.  Also, do
     556not page-align the data segment, and disable linking against shared
     557libraries.  If the output format supports Unix style magic numbers,
     558mark the output as \f(CW\*(C`OMAGIC\*(C'\fR.
     559.IP "\fB\-\-no\-omagic\fR" 4
     560.IX Item "--no-omagic"
     561This option negates most of the effects of the \fB\-N\fR option.  It
     562sets the text section to be read\-only, and forces the data segment to
     563be page\-aligned.  Note \- this option does not enable linking against
     564shared libraries.  Use \fB\-Bdynamic\fR for this.
     565.IP "\fB\-o\fR \fIoutput\fR" 4
     566.IX Item "-o output"
     567.PD 0
     568.IP "\fB\-\-output=\fR\fIoutput\fR" 4
     569.IX Item "--output=output"
     570.PD
     571Use \fIoutput\fR as the name for the program produced by \fBld\fR; if this
     572option is not specified, the name \fIa.out\fR is used by default.  The
     573script command \f(CW\*(C`OUTPUT\*(C'\fR can also specify the output file name.
     574.IP "\fB\-O\fR \fIlevel\fR" 4
     575.IX Item "-O level"
     576If \fIlevel\fR is a numeric values greater than zero \fBld\fR optimizes
     577the output.  This might take significantly longer and therefore probably
     578should only be enabled for the final binary.
     579.IP "\fB\-q\fR" 4
     580.IX Item "-q"
     581.PD 0
     582.IP "\fB\-\-emit\-relocs\fR" 4
     583.IX Item "--emit-relocs"
     584.PD
     585Leave relocation sections and contents in fully linked exececutables.
     586Post link analysis and optimization tools may need this information in
     587order to perform correct modifications of executables.  This results
     588in larger executables.
     589.Sp
     590This option is currently only supported on \s-1ELF\s0 platforms.
     591.IP "\fB\-r\fR" 4
     592.IX Item "-r"
     593.PD 0
     594.IP "\fB\-\-relocateable\fR" 4
     595.IX Item "--relocateable"
     596.PD
     597Generate relocatable output\-\-\-i.e., generate an output file that can in
     598turn serve as input to \fBld\fR.  This is often called \fIpartial
     599linking\fR.  As a side effect, in environments that support standard Unix
     600magic numbers, this option also sets the output file's magic number to
     601\&\f(CW\*(C`OMAGIC\*(C'\fR.
     602If this option is not specified, an absolute file is produced.  When
     603linking \*(C+ programs, this option \fIwill not\fR resolve references to
     604constructors; to do that, use \fB\-Ur\fR.
     605.Sp
     606When an input file does not have the same format as the output file,
     607partial linking is only supported if that input file does not contain any
     608relocations.  Different output formats can have further restrictions; for
     609example some \f(CW\*(C`a.out\*(C'\fR\-based formats do not support partial linking
     610with input files in other formats at all.
     611.Sp
     612This option does the same thing as \fB\-i\fR.
     613.IP "\fB\-R\fR \fIfilename\fR" 4
     614.IX Item "-R filename"
     615.PD 0
     616.IP "\fB\-\-just\-symbols=\fR\fIfilename\fR" 4
     617.IX Item "--just-symbols=filename"
     618.PD
     619Read symbol names and their addresses from \fIfilename\fR, but do not
     620relocate it or include it in the output.  This allows your output file
     621to refer symbolically to absolute locations of memory defined in other
     622programs.  You may use this option more than once.
     623.Sp
     624For compatibility with other \s-1ELF\s0 linkers, if the \fB\-R\fR option is
     625followed by a directory name, rather than a file name, it is treated as
     626the \fB\-rpath\fR option.
     627.IP "\fB\-s\fR" 4
     628.IX Item "-s"
     629.PD 0
     630.IP "\fB\-\-strip\-all\fR" 4
     631.IX Item "--strip-all"
     632.PD
     633Omit all symbol information from the output file.
     634.IP "\fB\-S\fR" 4
     635.IX Item "-S"
     636.PD 0
     637.IP "\fB\-\-strip\-debug\fR" 4
     638.IX Item "--strip-debug"
     639.PD
     640Omit debugger symbol information (but not all symbols) from the output file.
     641.IP "\fB\-t\fR" 4
     642.IX Item "-t"
     643.PD 0
     644.IP "\fB\-\-trace\fR" 4
     645.IX Item "--trace"
     646.PD
     647Print the names of the input files as \fBld\fR processes them.
     648.IP "\fB\-T\fR \fIscriptfile\fR" 4
     649.IX Item "-T scriptfile"
     650.PD 0
     651.IP "\fB\-\-script=\fR\fIscriptfile\fR" 4
     652.IX Item "--script=scriptfile"
     653.PD
     654Use \fIscriptfile\fR as the linker script.  This script replaces
     655\&\fBld\fR's default linker script (rather than adding to it), so
     656\&\fIcommandfile\fR must specify everything necessary to describe the
     657output file.    If \fIscriptfile\fR does not exist in
     658the current directory, \f(CW\*(C`ld\*(C'\fR looks for it in the directories
     659specified by any preceding \fB\-L\fR options.  Multiple \fB\-T\fR
     660options accumulate.
     661.IP "\fB\-u\fR \fIsymbol\fR" 4
     662.IX Item "-u symbol"
     663.PD 0
     664.IP "\fB\-\-undefined=\fR\fIsymbol\fR" 4
     665.IX Item "--undefined=symbol"
     666.PD
     667Force \fIsymbol\fR to be entered in the output file as an undefined
     668symbol.  Doing this may, for example, trigger linking of additional
     669modules from standard libraries.  \fB\-u\fR may be repeated with
     670different option arguments to enter additional undefined symbols.  This
     671option is equivalent to the \f(CW\*(C`EXTERN\*(C'\fR linker script command.
     672.IP "\fB\-Ur\fR" 4
     673.IX Item "-Ur"
     674For anything other than \*(C+ programs, this option is equivalent to
     675\&\fB\-r\fR: it generates relocatable output\-\-\-i.e., an output file that can in
     676turn serve as input to \fBld\fR.  When linking \*(C+ programs, \fB\-Ur\fR
     677\&\fIdoes\fR resolve references to constructors, unlike \fB\-r\fR.
     678It does not work to use \fB\-Ur\fR on files that were themselves linked
     679with \fB\-Ur\fR; once the constructor table has been built, it cannot
     680be added to.  Use \fB\-Ur\fR only for the last partial link, and
     681\&\fB\-r\fR for the others.
     682.IP "\fB\-\-unique[=\fR\fI\s-1SECTION\s0\fR\fB]\fR" 4
     683.IX Item "--unique[=SECTION]"
     684Creates a separate output section for every input section matching
     685\&\fI\s-1SECTION\s0\fR, or if the optional wildcard \fI\s-1SECTION\s0\fR argument is
     686missing, for every orphan input section.  An orphan section is one not
     687specifically mentioned in a linker script.  You may use this option
     688multiple times on the command line;  It prevents the normal merging of
     689input sections with the same name, overriding output section assignments
     690in a linker script.
     691.IP "\fB\-v\fR" 4
     692.IX Item "-v"
     693.PD 0
     694.IP "\fB\-\-version\fR" 4
     695.IX Item "--version"
     696.IP "\fB\-V\fR" 4
     697.IX Item "-V"
     698.PD
     699Display the version number for \fBld\fR.  The \fB\-V\fR option also
     700lists the supported emulations.
     701.IP "\fB\-x\fR" 4
     702.IX Item "-x"
     703.PD 0
     704.IP "\fB\-\-discard\-all\fR" 4
     705.IX Item "--discard-all"
     706.PD
     707Delete all local symbols.
     708.IP "\fB\-X\fR" 4
     709.IX Item "-X"
     710.PD 0
     711.IP "\fB\-\-discard\-locals\fR" 4
     712.IX Item "--discard-locals"
     713.PD
     714Delete all temporary local symbols.  For most targets, this is all local
     715symbols whose names begin with \fBL\fR.
     716.IP "\fB\-y\fR \fIsymbol\fR" 4
     717.IX Item "-y symbol"
     718.PD 0
     719.IP "\fB\-\-trace\-symbol=\fR\fIsymbol\fR" 4
     720.IX Item "--trace-symbol=symbol"
     721.PD
     722Print the name of each linked file in which \fIsymbol\fR appears.  This
     723option may be given any number of times.  On many systems it is necessary
     724to prepend an underscore.
     725.Sp
     726This option is useful when you have an undefined symbol in your link but
     727don't know where the reference is coming from.
     728.IP "\fB\-Y\fR \fIpath\fR" 4
     729.IX Item "-Y path"
     730Add \fIpath\fR to the default library search path.  This option exists
     731for Solaris compatibility.
     732.IP "\fB\-z\fR \fIkeyword\fR" 4
     733.IX Item "-z keyword"
     734The recognized keywords are \f(CW\*(C`initfirst\*(C'\fR, \f(CW\*(C`interpose\*(C'\fR,
     735\&\f(CW\*(C`loadfltr\*(C'\fR, \f(CW\*(C`nodefaultlib\*(C'\fR, \f(CW\*(C`nodelete\*(C'\fR, \f(CW\*(C`nodlopen\*(C'\fR,
     736\&\f(CW\*(C`nodump\*(C'\fR, \f(CW\*(C`now\*(C'\fR, \f(CW\*(C`origin\*(C'\fR, \f(CW\*(C`combreloc\*(C'\fR, \f(CW\*(C`nocombreloc\*(C'\fR
     737and \f(CW\*(C`nocopyreloc\*(C'\fR.
     738The other keywords are
     739ignored for Solaris compatibility. \f(CW\*(C`initfirst\*(C'\fR marks the object
     740to be initialized first at runtime before any other objects.
     741\&\f(CW\*(C`interpose\*(C'\fR marks the object that its symbol table interposes
     742before all symbols but the primary executable. \f(CW\*(C`loadfltr\*(C'\fR marks
     743the object that its filtees be processed immediately at runtime.
     744\&\f(CW\*(C`nodefaultlib\*(C'\fR marks the object that the search for dependencies
     745of this object will ignore any default library search paths.
     746\&\f(CW\*(C`nodelete\*(C'\fR marks the object shouldn't be unloaded at runtime.
     747\&\f(CW\*(C`nodlopen\*(C'\fR marks the object not available to \f(CW\*(C`dlopen\*(C'\fR.
     748\&\f(CW\*(C`nodump\*(C'\fR marks the object can not be dumped by \f(CW\*(C`dldump\*(C'\fR.
     749\&\f(CW\*(C`now\*(C'\fR marks the object with the non-lazy runtime binding.
     750\&\f(CW\*(C`origin\*(C'\fR marks the object may contain \f(CW$ORIGIN\fR.
     751\&\f(CW\*(C`defs\*(C'\fR disallows undefined symbols.
     752\&\f(CW\*(C`muldefs\*(C'\fR allows multiple definitions.
     753\&\f(CW\*(C`combreloc\*(C'\fR combines multiple reloc sections and sorts them
     754to make dynamic symbol lookup caching possible.
     755\&\f(CW\*(C`nocombreloc\*(C'\fR disables multiple reloc sections combining.
     756\&\f(CW\*(C`nocopyreloc\*(C'\fR disables production of copy relocs.
     757.IP "\fB\-(\fR \fIarchives\fR \fB\-)\fR" 4
     758.IX Item "-( archives -)"
     759.PD 0
     760.IP "\fB\-\-start\-group\fR \fIarchives\fR \fB\-\-end\-group\fR" 4
     761.IX Item "--start-group archives --end-group"
     762.PD
     763The \fIarchives\fR should be a list of archive files.  They may be
     764either explicit file names, or \fB\-l\fR options.
     765.Sp
     766The specified archives are searched repeatedly until no new undefined
     767references are created.  Normally, an archive is searched only once in
     768the order that it is specified on the command line.  If a symbol in that
     769archive is needed to resolve an undefined symbol referred to by an
     770object in an archive that appears later on the command line, the linker
     771would not be able to resolve that reference.  By grouping the archives,
     772they all be searched repeatedly until all possible references are
     773resolved.
     774.Sp
     775Using this option has a significant performance cost.  It is best to use
     776it only when there are unavoidable circular references between two or
     777more archives.
     778.IP "\fB\-\-accept\-unknown\-input\-arch\fR" 4
     779.IX Item "--accept-unknown-input-arch"
     780.PD 0
     781.IP "\fB\-\-no\-accept\-unknown\-input\-arch\fR" 4
     782.IX Item "--no-accept-unknown-input-arch"
     783.PD
     784Tells the linker to accept input files whose architecture cannot be
     785recognised.  The assumption is that the user knows what they are doing
     786and deliberately wants to link in these unknown input files.  This was
     787the default behaviour of the linker, before release 2.14.  The default
     788behaviour from release 2.14 onwards is to reject such input files, and
     789so the \fB\-\-accept\-unknown\-input\-arch\fR option has been added to
     790restore the old behaviour.
     791.IP "\fB\-assert\fR \fIkeyword\fR" 4
     792.IX Item "-assert keyword"
     793This option is ignored for SunOS compatibility.
     794.IP "\fB\-Bdynamic\fR" 4
     795.IX Item "-Bdynamic"
     796.PD 0
     797.IP "\fB\-dy\fR" 4
     798.IX Item "-dy"
     799.IP "\fB\-call_shared\fR" 4
     800.IX Item "-call_shared"
     801.PD
    406802Link against dynamic libraries.  This is only meaningful on platforms
    407803for which shared libraries are supported.  This option is normally the
    408 default on such platforms.
    409 
    410 .TP
    411 .B \-Bgroup
    412 Set the \c
    413 .B DF_1_GROUP
    414 \c
    415 flag in the \c
    416 .B DT_FLAGS_1
    417 \c
    418 entry in the dynamic section.  This causes the runtime linker to handle
    419 lookups in this object and its dependencies to be performed only inside
    420 the group.  No undefined symbols are allowed.  This option is only
    421 meaningful on ELF platforms which support shared libraries.
    422 
    423 .TP
    424 .B \-Bsymbolic
    425 When creating a shared library, bind references to global symbols to
    426 the definition within the shared library, if any.  Normally, it is
    427 possible for a program linked against a shared library to override the
    428 definition within the shared library.  This option is only meaningful
    429 on ELF platforms which support shared libraries.
    430 
    431 .TP
    432 .BI "\-c " "commandfile"
    433 Directs \c
    434 .B ld\c
    435 \& to read link commands from the file
    436 \c
    437 .I commandfile\c
    438 \&.  These commands will completely override \c
    439 .B ld\c
    440 \&'s
    441 default link format (rather than adding to it); \c
    442 .I commandfile\c
    443 \& must
    444 specify everything necessary to describe the target format.
    445 
    446 
    447 You may also include a script of link commands directly in the command
    448 line by bracketing it between `\|\c
    449 .B {\c
    450 \|' and `\|\c
    451 .B }\c
    452 \|' characters.
    453 
    454 .TP
    455 .B \-\-cref
     804default on such platforms.  The different variants of this option are
     805for compatibility with various systems.  You may use this option
     806multiple times on the command line: it affects library searching for
     807\&\fB\-l\fR options which follow it.
     808.IP "\fB\-Bgroup\fR" 4
     809.IX Item "-Bgroup"
     810Set the \f(CW\*(C`DF_1_GROUP\*(C'\fR flag in the \f(CW\*(C`DT_FLAGS_1\*(C'\fR entry in the dynamic
     811section.  This causes the runtime linker to handle lookups in this
     812object and its dependencies to be performed only inside the group.
     813\&\fB\-\-no\-undefined\fR is implied.  This option is only meaningful on \s-1ELF\s0
     814platforms which support shared libraries.
     815.IP "\fB\-Bstatic\fR" 4
     816.IX Item "-Bstatic"
     817.PD 0
     818.IP "\fB\-dn\fR" 4
     819.IX Item "-dn"
     820.IP "\fB\-non_shared\fR" 4
     821.IX Item "-non_shared"
     822.IP "\fB\-static\fR" 4
     823.IX Item "-static"
     824.PD
     825Do not link against shared libraries.  This is only meaningful on
     826platforms for which shared libraries are supported.  The different
     827variants of this option are for compatibility with various systems.  You
     828may use this option multiple times on the command line: it affects
     829library searching for \fB\-l\fR options which follow it.
     830.IP "\fB\-Bsymbolic\fR" 4
     831.IX Item "-Bsymbolic"
     832When creating a shared library, bind references to global symbols to the
     833definition within the shared library, if any.  Normally, it is possible
     834for a program linked against a shared library to override the definition
     835within the shared library.  This option is only meaningful on \s-1ELF\s0
     836platforms which support shared libraries.
     837.IP "\fB\-\-check\-sections\fR" 4
     838.IX Item "--check-sections"
     839.PD 0
     840.IP "\fB\-\-no\-check\-sections\fR" 4
     841.IX Item "--no-check-sections"
     842.PD
     843Asks the linker \fInot\fR to check section addresses after they have
     844been assigned to see if there any overlaps.  Normally the linker will
     845perform this check, and if it finds any overlaps it will produce
     846suitable error messages.  The linker does know about, and does make
     847allowances for sections in overlays.  The default behaviour can be
     848restored by using the command line switch \fB\-\-check\-sections\fR.
     849.IP "\fB\-\-cref\fR" 4
     850.IX Item "--cref"
    456851Output a cross reference table.  If a linker map file is being
    457852generated, the cross reference table is printed to the map file.
    458853Otherwise, it is printed on the standard output.
    459 
    460 .TP
    461 .B \-d
    462 .TP
    463 .B \-dc
    464 .TP
    465 .B \-dp
    466 These three options are equivalent; multiple forms are supported for
    467 compatibility with other linkers.  Use any of them to make \c
    468 .B ld
    469 assign space to common symbols even if a relocatable output file is
    470 specified (\c
    471 .B \-r\c
    472 \&).  The script command
    473 \c
    474 .B FORCE_COMMON_ALLOCATION\c
    475 \& has the same effect.
    476 
    477 .TP
    478 .BI "-defsym " "symbol" "\fR=\fP" expression
     854.Sp
     855The format of the table is intentionally simple, so that it may be
     856easily processed by a script if necessary.  The symbols are printed out,
     857sorted by name.  For each symbol, a list of file names is given.  If the
     858symbol is defined, the first file listed is the location of the
     859definition.  The remaining files contain references to the symbol.
     860.IP "\fB\-\-no\-define\-common\fR" 4
     861.IX Item "--no-define-common"
     862This option inhibits the assignment of addresses to common symbols.
     863The script command \f(CW\*(C`INHIBIT_COMMON_ALLOCATION\*(C'\fR has the same effect.
     864.Sp
     865The \fB\-\-no\-define\-common\fR option allows decoupling
     866the decision to assign addresses to Common symbols from the choice
     867of the output file type; otherwise a non-Relocatable output type
     868forces assigning addresses to Common symbols.
     869Using \fB\-\-no\-define\-common\fR allows Common symbols that are referenced
     870from a shared library to be assigned addresses only in the main program.
     871This eliminates the unused duplicate space in the shared library,
     872and also prevents any possible confusion over resolving to the wrong
     873duplicate when there are many dynamic modules with specialized search
     874paths for runtime symbol resolution.
     875.IP "\fB\-\-defsym\fR \fIsymbol\fR\fB=\fR\fIexpression\fR" 4
     876.IX Item "--defsym symbol=expression"
    479877Create a global symbol in the output file, containing the absolute
    480 address given by \c
    481 .I expression\c
    482 \&.  You may use this option as many
     878address given by \fIexpression\fR.  You may use this option as many
    483879times as necessary to define multiple symbols in the command line.  A
    484 limited form of arithmetic is supported for the \c
    485 .I expression\c
    486 \& in this
     880limited form of arithmetic is supported for the \fIexpression\fR in this
    487881context: you may give a hexadecimal constant or the name of an existing
    488 symbol, or use \c
    489 .B +\c
    490 \& and \c
    491 .B \-\c
    492 \& to add or subtract hexadecimal
     882symbol, or use \f(CW\*(C`+\*(C'\fR and \f(CW\*(C`\-\*(C'\fR to add or subtract hexadecimal
    493883constants or symbols.  If you need more elaborate expressions, consider
    494 using the linker command language from a script.
    495 
    496 .TP
    497 .B \-\-demangle
    498 .TP
    499 .B \-\-no\-demangle
    500 These options control whether to demangle symbol names in error
    501 messages and other output.  When the linker is told to demangle, it
    502 tries to present symbol names in a readable fashion: it strips leading
    503 underscores if they are used by the object file format, and converts
    504 C++ mangled symbol names into user readable names.  The linker will
    505 demangle by default unless the environment variable
    506 .B COLLECT_NO_DEMANGLE
     884using the linker command language from a script.  \fINote:\fR there should be no white
     885space between \fIsymbol\fR, the equals sign (``\fB=\fR''), and
     886\&\fIexpression\fR.
     887.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4
     888.IX Item "--demangle[=style]"
     889.PD 0
     890.IP "\fB\-\-no\-demangle\fR" 4
     891.IX Item "--no-demangle"
     892.PD
     893These options control whether to demangle symbol names in error messages
     894and other output.  When the linker is told to demangle, it tries to
     895present symbol names in a readable fashion: it strips leading
     896underscores if they are used by the object file format, and converts \*(C+
     897mangled symbol names into user readable names.  Different compilers have
     898different mangling styles.  The optional demangling style argument can be used
     899to choose an appropriate demangling style for your compiler.  The linker will
     900demangle by default unless the environment variable \fB\s-1COLLECT_NO_DEMANGLE\s0\fR
    507901is set.  These options may be used to override the default.
    508 
    509 .TP
    510 .BI "-e " "entry"\c
    511 \&
    512 Use \c
    513 .I entry\c
    514 \& as the explicit symbol for beginning execution of your
    515 program, rather than the default entry point.  See the `\|\c
    516 .B ld\c
    517 \|' entry in `\|\c
    518 .B info\c
    519 \|' for a
    520 discussion of defaults and other ways of specifying the
    521 entry point.
    522 
    523 .TP
    524 .B \-embedded\-relocs
    525 This option is only meaningful when linking MIPS embedded PIC code,
    526 generated by the
    527 .B \-membedded\-pic
    528 option to the GNU compiler and assembler.  It causes the linker to
    529 create a table which may be used at runtime to relocate any data which
    530 was statically initialized to pointer values.  See the code in
    531 testsuite/ld-empic for details.
    532 
    533 .TP
    534 .B \-E
    535 .TP
    536 .B \-export\-dynamic
    537 When creating an ELF file, add all symbols to the dynamic symbol table.
    538 Normally, the dynamic symbol table contains only symbols which are used
    539 by a dynamic object.  This option is needed for some uses of
    540 .I dlopen.
    541 
    542 .TP
    543 .BI "-f " "name"
    544 .TP
    545 .BI "--auxiliary " "name"
    546 When creating an ELF shared object, set the internal DT_AUXILIARY field
    547 to the specified name.  This tells the dynamic linker that the symbol
    548 table of the shared object should be used as an auxiliary filter on the
    549 symbol table of the shared object
    550 .I name.
    551 
    552 .TP
    553 .BI "-F " "name"
    554 .TP
    555 .BI "--filter " "name"
    556 When creating an ELF shared object, set the internal DT_FILTER field to
    557 the specified name.  This tells the dynamic linker that the symbol table
    558 of the shared object should be used as a filter on the symbol table of
    559 the shared object
    560 .I name.
    561 
    562 .TP
    563 .BI "\-format " "input\-format"
    564 Synonym for \c
    565 .B \-b\c
    566 \& \c
    567 .I input\-format\c
    568 \&.
    569 
    570 .TP
    571 .B \-g
    572 Accepted, but ignored; provided for compatibility with other tools.
    573 
    574 .TP
    575 .BI "\-G " "size"\c
    576 Set the maximum size of objects to be optimized using the GP register
    577 to
    578 .I size
    579 under MIPS ECOFF.  Ignored for other object file formats.
    580 
    581 .TP
    582 .BI "-h " "name"
    583 .TP
    584 .BI "-soname " "name"
    585 When creating an ELF shared object, set the internal DT_SONAME field to
    586 the specified name.  When an executable is linked with a shared object
    587 which has a DT_SONAME field, then when the executable is run the dynamic
    588 linker will attempt to load the shared object specified by the DT_SONAME
    589 field rather than the using the file name given to the linker.
    590 
    591 .TP
    592 .B \-\-help
     902.IP "\fB\-\-dynamic\-linker\fR \fIfile\fR" 4
     903.IX Item "--dynamic-linker file"
     904Set the name of the dynamic linker.  This is only meaningful when
     905generating dynamically linked \s-1ELF\s0 executables.  The default dynamic
     906linker is normally correct; don't use this unless you know what you are
     907doing.
     908.IP "\fB\-\-embedded\-relocs\fR" 4
     909.IX Item "--embedded-relocs"
     910This option is only meaningful when linking \s-1MIPS\s0 embedded \s-1PIC\s0 code,
     911generated by the \-membedded\-pic option to the \s-1GNU\s0 compiler and
     912assembler.  It causes the linker to create a table which may be used at
     913runtime to relocate any data which was statically initialized to pointer
     914values.  See the code in testsuite/ld\-empic for details.
     915.IP "\fB\-\-fatal\-warnings\fR" 4
     916.IX Item "--fatal-warnings"
     917Treat all warnings as errors.
     918.IP "\fB\-\-force\-exe\-suffix\fR" 4
     919.IX Item "--force-exe-suffix"
     920Make sure that an output file has a .exe suffix.
     921.Sp
     922If a successfully built fully linked output file does not have a
     923\&\f(CW\*(C`.exe\*(C'\fR or \f(CW\*(C`.dll\*(C'\fR suffix, this option forces the linker to copy
     924the output file to one of the same name with a \f(CW\*(C`.exe\*(C'\fR suffix. This
     925option is useful when using unmodified Unix makefiles on a Microsoft
     926Windows host, since some versions of Windows won't run an image unless
     927it ends in a \f(CW\*(C`.exe\*(C'\fR suffix.
     928.IP "\fB\-\-no\-gc\-sections\fR" 4
     929.IX Item "--no-gc-sections"
     930.PD 0
     931.IP "\fB\-\-gc\-sections\fR" 4
     932.IX Item "--gc-sections"
     933.PD
     934Enable garbage collection of unused input sections.  It is ignored on
     935targets that do not support this option.  This option is not compatible
     936with \fB\-r\fR, nor should it be used with dynamic linking.  The default
     937behaviour (of not performing this garbage collection) can be restored by
     938specifying \fB\-\-no\-gc\-sections\fR on the command line.
     939.IP "\fB\-\-help\fR" 4
     940.IX Item "--help"
    593941Print a summary of the command-line options on the standard output and exit.
    594 This option and
    595 .B \-\-version
    596 begin with two dashes instead of one
    597 for compatibility with other GNU programs.  The other options start with
    598 only one dash for compatibility with other linkers.
    599 
    600 .TP
    601 .B \-i
    602 Perform an incremental link (same as option \c
    603 .B \-r\c
    604 \&).
    605 
    606 .TP
    607 .BI "\-l" "ar"\c
    608 \&
    609 Add an archive file \c
    610 .I ar\c
    611 \& to the list of files to link.  This
    612 option may be used any number of times.  \c
    613 .B ld\c
    614 \& will search its
    615 path-list for occurrences of \c
    616 .B lib\c
    617 .I ar\c
    618 \&.a\c
    619 \& for every \c
    620 .I ar
    621 specified.
    622 
    623 .TP
    624 .BI "\-L" "searchdir"
    625 This command adds path \c
    626 .I searchdir\c
    627 \& to the list of paths that
    628 \c
    629 .B ld\c
    630 \& will search for archive libraries.  You may use this option
    631 any number of times.
    632 
    633 The default set of paths searched (without being specified with
    634 \c
    635 .B \-L\c
    636 \&) depends on what emulation mode \c
    637 .B ld\c
    638 \& is using, and in
    639 some cases also on how it was configured.    The
    640 paths can also be specified in a link script with the \c
    641 .B SEARCH_DIR
    642 command.
    643 
    644 .TP
    645 .B \-M
    646 Print (to the standard output file) a link map\(em\&diagnostic information
    647 about where symbols are mapped by \c
    648 .B ld\c
    649 \&, and information on global
    650 common storage allocation.
    651 
    652 .TP
    653 .BI "\-Map " "mapfile"\c
    654 Print to the file
    655 .I mapfile
    656 a link map\(em\&diagnostic information
    657 about where symbols are mapped by \c
    658 .B ld\c
    659 \&, and information on global
    660 common storage allocation.
    661 
    662 .TP
    663 .BI "\-m " "emulation"\c
    664 Emulate the
    665 .I emulation
    666 linker.  You can list the available emulations with the
    667 .I \-\-verbose
    668 or
    669 .I \-V
    670 options.  This option overrides the compiled-in default, which is the
    671 system for which you configured
    672 .BR ld .
    673 
    674 .TP
    675 .B \-N
    676 specifies readable and writable \c
    677 .B text\c
    678 \& and \c
    679 .B data\c
    680 \& sections. If
    681 the output format supports Unix style magic numbers, the output is
    682 marked as \c
    683 .B OMAGIC\c
    684 \&.
    685 
    686 When you use the `\|\c
    687 .B \-N\c
    688 \&\|' option, the linker does not page-align the
    689 data segment.
    690 
    691 .TP
    692 .B \-n
    693 sets the text segment to be read only, and \c
    694 .B NMAGIC\c
    695 \& is written
    696 if possible.
    697 
    698 .TP
    699 .B \-noinhibit\-exec
     942.IP "\fB\-\-target\-help\fR" 4
     943.IX Item "--target-help"
     944Print a summary of all target specific options on the standard output and exit.
     945.IP "\fB\-Map\fR \fImapfile\fR" 4
     946.IX Item "-Map mapfile"
     947Print a link map to the file \fImapfile\fR.  See the description of the
     948\&\fB\-M\fR option, above.
     949.IP "\fB\-\-no\-keep\-memory\fR" 4
     950.IX Item "--no-keep-memory"
     951\&\fBld\fR normally optimizes for speed over memory usage by caching the
     952symbol tables of input files in memory.  This option tells \fBld\fR to
     953instead optimize for memory usage, by rereading the symbol tables as
     954necessary.  This may be required if \fBld\fR runs out of memory space
     955while linking a large executable.
     956.IP "\fB\-\-no\-undefined\fR" 4
     957.IX Item "--no-undefined"
     958.PD 0
     959.IP "\fB\-z defs\fR" 4
     960.IX Item "-z defs"
     961.PD
     962Normally when creating a non-symbolic shared library, undefined symbols
     963are allowed and left to be resolved by the runtime loader.  This option
     964disallows such undefined symbols if they come from regular object
     965files.  The switch \fB\-\-no\-allow\-shlib\-undefined\fR controls the
     966behaviour for shared objects being linked into the shared library.
     967.IP "\fB\-\-allow\-multiple\-definition\fR" 4
     968.IX Item "--allow-multiple-definition"
     969.PD 0
     970.IP "\fB\-z muldefs\fR" 4
     971.IX Item "-z muldefs"
     972.PD
     973Normally when a symbol is defined multiple times, the linker will
     974report a fatal error. These options allow multiple definitions and the
     975first definition will be used.
     976.IP "\fB\-\-allow\-shlib\-undefined\fR" 4
     977.IX Item "--allow-shlib-undefined"
     978.PD 0
     979.IP "\fB\-\-no\-allow\-shlib\-undefined\fR" 4
     980.IX Item "--no-allow-shlib-undefined"
     981.PD
     982Allow (the default) or disallow undefined symbols in shared objects.
     983The setting of this switch overrides \fB\-\-no\-undefined\fR where
     984shared objects are concerned.  Thus if \fB\-\-no\-undefined\fR is set
     985but \fB\-\-no\-allow\-shlib\-undefined\fR is not, the net result will be
     986that undefined symbols in regular object files will trigger an error,
     987but undefined symbols in shared objects will be ignored.
     988.Sp
     989The reason that \fB\-\-allow\-shlib\-undefined\fR is the default is that
     990the shared object being specified at link time may not be the same one
     991that is available at load time, so the symbols might actually be
     992resolvable at load time.  Plus there are some systems, (eg BeOS) where
     993undefined symbols in shared libraries is normal since the kernel
     994patches them at load time to select which function is most appropriate
     995for the current architecture. eg. to dynamically select an appropriate
     996memset function.  Apparently it is also normal for \s-1HPPA\s0 shared
     997libraries to have undefined symbols.
     998.IP "\fB\-\-no\-undefined\-version\fR" 4
     999.IX Item "--no-undefined-version"
     1000Normally when a symbol has an undefined version, the linker will ignore
     1001it. This option disallows symbols with undefined version and a fatal error
     1002will be issued instead.
     1003.IP "\fB\-\-no\-warn\-mismatch\fR" 4
     1004.IX Item "--no-warn-mismatch"
     1005Normally \fBld\fR will give an error if you try to link together input
     1006files that are mismatched for some reason, perhaps because they have
     1007been compiled for different processors or for different endiannesses.
     1008This option tells \fBld\fR that it should silently permit such possible
     1009errors.  This option should only be used with care, in cases when you
     1010have taken some special action that ensures that the linker errors are
     1011inappropriate.
     1012.IP "\fB\-\-no\-whole\-archive\fR" 4
     1013.IX Item "--no-whole-archive"
     1014Turn off the effect of the \fB\-\-whole\-archive\fR option for subsequent
     1015archive files.
     1016.IP "\fB\-\-noinhibit\-exec\fR" 4
     1017.IX Item "--noinhibit-exec"
     1018Retain the executable output file whenever it is still usable.
    7001019Normally, the linker will not produce an output file if it encounters
    701 errors during the link process.  With this flag, you can specify that
    702 you wish the output file retained even after non-fatal errors.
    703 
    704 .TP
    705 .B \-no\-keep\-memory
    706 The linker normally optimizes for speed over memory usage by caching
    707 the symbol tables of input files in memory.  This option tells the
    708 linker to instead optimize for memory usage, by rereading the symbol
    709 tables as necessary.  This may be required if the linker runs out of
    710 memory space while linking a large executable.
    711 
    712 .TP
    713 .B \-no\-warn\-mismatch
    714 Normally the linker will give an error if you try to link together
    715 input files that are mismatched for some reason, perhaps because they
    716 have been compiled for different processors or for different
    717 endiannesses.  This option tells the linker that it should silently
    718 permit such possible errors.  This option should only be used with
    719 care, in cases when you have taken some special action that ensures
    720 that the linker errors are inappropriate.
    721 
    722 .TP
    723 .BI "\-o " "output"
    724 .I output\c
    725 \& is a name for the program produced by \c
    726 .B ld\c
    727 \&; if this
    728 option is not specified, the name `\|\c
    729 .B a.out\c
    730 \|' is used by default.  The
    731 script command \c
    732 .B OUTPUT\c
    733 \& can also specify the output file name.
    734 
    735 .TP
    736 .BI "\-O" "level"
    737 Generate optimized output files.  This might use significantly more
    738 time and therefore probably should be enabled only for generating the
    739 final binary.
    740 \c
    741 .I level\c
    742 \& is supposed to be a numeric value.  Any value greater than zero enables
    743 the optimizations.
    744 
    745 .TP
    746 .BI "\--oformat " "output\-format"
    747 Specify the binary format for the output object file.
    748 You don't usually need to specify this, as
    749 \c
    750 .B ld\c
    751 \& is configured to produce as a default output format the most
    752 usual format on each machine.  \c
    753 .I output-format\c
    754 \& is a text string, the
    755 name of a particular format supported by the BFD libraries. 
    756 The script command
    757 .B OUTPUT_FORMAT
    758 can also specify the output format, but this option overrides it.
    759 
    760 .TP
    761 .BI "\-R " "filename"
    762 Read symbol names and their addresses from \c
    763 .I filename\c
    764 \&, but do not
    765 relocate it or include it in the output.  This allows your output file
    766 to refer symbolically to absolute locations of memory defined in other
    767 programs.
    768 
    769 .TP
    770 .B \-relax
    771 An option with machine dependent effects.  Currently this option is only
    772 supported on the H8/300.
    773 
    774 On some platforms, use this option to perform global optimizations that
    775 become possible when the linker resolves addressing in your program, such
    776 as relaxing address modes and synthesizing new instructions in the
    777 output object file. 
    778 
    779 On platforms where this is not supported, `\|\c
    780 .B \-relax\c
    781 \&\|' is accepted, but has no effect.
    782 
    783 .TP
    784 .B \-r
    785 Generates relocatable output\(em\&i.e., generate an output file that can in
    786 turn serve as input to \c
    787 .B ld\c
    788 \&.  This is often called \c
    789 .I partial
    790 linking\c
    791 \&.  As a side effect, in environments that support standard Unix
    792 magic numbers, this option also sets the output file's magic number to
    793 \c
    794 .B OMAGIC\c
    795 \&.
    796 If this option is not specified, an absolute file is produced.  When
    797 linking C++ programs, this option \c
    798 .I will not\c
    799 \& resolve references to
    800 constructors; \c
    801 .B \-Ur\c
    802 \& is an alternative.
    803 
    804 This option does the same as \c
    805 .B \-i\c
    806 \&.
    807 
    808 .TP
    809 .B \-rpath\ \fIdirectory
     1020errors during the link process; it exits without writing an output file
     1021when it issues any error whatsoever.
     1022.IP "\fB\-nostdlib\fR" 4
     1023.IX Item "-nostdlib"
     1024Only search library directories explicitly specified on the
     1025command line.  Library directories specified in linker scripts
     1026(including linker scripts specified on the command line) are ignored.
     1027.IP "\fB\-\-oformat\fR \fIoutput-format\fR" 4
     1028.IX Item "--oformat output-format"
     1029\&\fBld\fR may be configured to support more than one kind of object
     1030file.  If your \fBld\fR is configured this way, you can use the
     1031\&\fB\-\-oformat\fR option to specify the binary format for the output
     1032object file.  Even when \fBld\fR is configured to support alternative
     1033object formats, you don't usually need to specify this, as \fBld\fR
     1034should be configured to produce as a default output format the most
     1035usual format on each machine.  \fIoutput-format\fR is a text string, the
     1036name of a particular format supported by the \s-1BFD\s0 libraries.  (You can
     1037list the available binary formats with \fBobjdump \-i\fR.)  The script
     1038command \f(CW\*(C`OUTPUT_FORMAT\*(C'\fR can also specify the output format, but
     1039this option overrides it. 
     1040.IP "\fB\-qmagic\fR" 4
     1041.IX Item "-qmagic"
     1042This option is ignored for Linux compatibility.
     1043.IP "\fB\-Qy\fR" 4
     1044.IX Item "-Qy"
     1045This option is ignored for \s-1SVR4\s0 compatibility.
     1046.IP "\fB\-\-relax\fR" 4
     1047.IX Item "--relax"
     1048An option with machine dependent effects.
     1049This option is only supported on a few targets.
     1050.Sp
     1051On some platforms, the \fB\-\-relax\fR option performs global
     1052optimizations that become possible when the linker resolves addressing
     1053in the program, such as relaxing address modes and synthesizing new
     1054instructions in the output object file.
     1055.Sp
     1056On some platforms these link time global optimizations may make symbolic
     1057debugging of the resulting executable impossible.
     1058This is known to be
     1059the case for the Matsushita \s-1MN10200\s0 and \s-1MN10300\s0 family of processors.
     1060.Sp
     1061On platforms where this is not supported, \fB\-\-relax\fR is accepted,
     1062but ignored.
     1063.IP "\fB\-\-retain\-symbols\-file\fR \fIfilename\fR" 4
     1064.IX Item "--retain-symbols-file filename"
     1065Retain \fIonly\fR the symbols listed in the file \fIfilename\fR,
     1066discarding all others.  \fIfilename\fR is simply a flat file, with one
     1067symbol name per line.  This option is especially useful in environments
     1068(such as VxWorks)
     1069where a large global symbol table is accumulated gradually, to conserve
     1070run-time memory.
     1071.Sp
     1072\&\fB\-\-retain\-symbols\-file\fR does \fInot\fR discard undefined symbols,
     1073or symbols needed for relocations.
     1074.Sp
     1075You may only specify \fB\-\-retain\-symbols\-file\fR once in the command
     1076line.  It overrides \fB\-s\fR and \fB\-S\fR.
     1077.IP "\fB\-rpath\fR \fIdir\fR" 4
     1078.IX Item "-rpath dir"
    8101079Add a directory to the runtime library search path.  This is used when
    811 linking an ELF executable with shared objects.  All
    812 .B \-rpath
     1080linking an \s-1ELF\s0 executable with shared objects.  All \fB\-rpath\fR
    8131081arguments are concatenated and passed to the runtime linker, which uses
    814 them to locate shared objects at runtime.  The
    815 .B \-rpath
    816 option is also used when locating shared objects which are needed by
    817 shared objects explicitly included in the link; see the description of
    818 the
    819 .B \-rpath\-link
    820 option.  If
    821 .B \-rpath
    822 is not used when linking an ELF executable, the contents of the
    823 environment variable
    824 .B LD_RUN_PATH
    825 will be used if it is defined.
    826 
    827 The
    828 .B \-rpath
    829 option may also be used on SunOS.  By default, on SunOS, the linker
    830 will form a runtime search path out of all the
    831 .B \-L
    832 options it is given.  If a
    833 .B \-rpath
    834 option is used, the runtime search path will be formed exclusively
    835 using the
    836 .B \-rpath
    837 options, ignoring
    838 the
    839 .B \-L
    840 options.  This can be useful when using gcc, which adds many
    841 .B \-L
    842 options which may be on NFS mounted filesystems.
    843 
    844 .TP
    845 .B \-rpath\-link\ \fIdirectory
    846 When using ELF or SunOS, one shared library may require another.  This
    847 happens when an
    848 .B ld\ \-shared
    849 link includes a shared library as one of the input files.
    850 
    851 When the linker encounters such a dependency when doing a non-shared,
    852 non-relocateable link, it will automatically try to locate the required
     1082them to locate shared objects at runtime.  The \fB\-rpath\fR option is
     1083also used when locating shared objects which are needed by shared
     1084objects explicitly included in the link; see the description of the
     1085\&\fB\-rpath\-link\fR option.  If \fB\-rpath\fR is not used when linking an
     1086\&\s-1ELF\s0 executable, the contents of the environment variable
     1087\&\f(CW\*(C`LD_RUN_PATH\*(C'\fR will be used if it is defined.
     1088.Sp
     1089The \fB\-rpath\fR option may also be used on SunOS.  By default, on
     1090SunOS, the linker will form a runtime search patch out of all the
     1091\&\fB\-L\fR options it is given.  If a \fB\-rpath\fR option is used, the
     1092runtime search path will be formed exclusively using the \fB\-rpath\fR
     1093options, ignoring the \fB\-L\fR options.  This can be useful when using
     1094gcc, which adds many \fB\-L\fR options which may be on \s-1NFS\s0 mounted
     1095filesystems.
     1096.Sp
     1097For compatibility with other \s-1ELF\s0 linkers, if the \fB\-R\fR option is
     1098followed by a directory name, rather than a file name, it is treated as
     1099the \fB\-rpath\fR option.
     1100.IP "\fB\-rpath\-link\fR \fI\s-1DIR\s0\fR" 4
     1101.IX Item "-rpath-link DIR"
     1102When using \s-1ELF\s0 or SunOS, one shared library may require another.  This
     1103happens when an \f(CW\*(C`ld \-shared\*(C'\fR link includes a shared library as one
     1104of the input files.
     1105.Sp
     1106When the linker encounters such a dependency when doing a non\-shared,
     1107non-relocatable link, it will automatically try to locate the required
    8531108shared library and include it in the link, if it is not included
    854 explicitly.  In such a case, the
    855 .B \-rpath\-link
    856 option specifies the first set of directories to search.  The
    857 .B \-rpath\-link
    858 option may specify a sequence of directory names either by specifying
    859 a list of names separated by colons, or by appearing multiple times.
    860 
     1109explicitly.  In such a case, the \fB\-rpath\-link\fR option
     1110specifies the first set of directories to search.  The
     1111\&\fB\-rpath\-link\fR option may specify a sequence of directory names
     1112either by specifying a list of names separated by colons, or by
     1113appearing multiple times.
     1114.Sp
     1115This option should be used with caution as it overrides the search path
     1116that may have been hard compiled into a shared library. In such a case it
     1117is possible to use unintentionally a different search path than the
     1118runtime linker would do.
     1119.Sp
     1120The linker uses the following search paths to locate required shared
     1121libraries.
     1122.RS 4
     1123.IP "1." 4
     1124Any directories specified by \fB\-rpath\-link\fR options.
     1125.IP "2." 4
     1126Any directories specified by \fB\-rpath\fR options.  The difference
     1127between \fB\-rpath\fR and \fB\-rpath\-link\fR is that directories
     1128specified by \fB\-rpath\fR options are included in the executable and
     1129used at runtime, whereas the \fB\-rpath\-link\fR option is only effective
     1130at link time. It is for the native linker only.
     1131.IP "3." 4
     1132On an \s-1ELF\s0 system, if the \fB\-rpath\fR and \f(CW\*(C`rpath\-link\*(C'\fR options
     1133were not used, search the contents of the environment variable
     1134\&\f(CW\*(C`LD_RUN_PATH\*(C'\fR. It is for the native linker only.
     1135.IP "4." 4
     1136On SunOS, if the \fB\-rpath\fR option was not used, search any
     1137directories specified using \fB\-L\fR options.
     1138.IP "5." 4
     1139For a native linker, the contents of the environment variable
     1140\&\f(CW\*(C`LD_LIBRARY_PATH\*(C'\fR.
     1141.IP "6." 4
     1142For a native \s-1ELF\s0 linker, the directories in \f(CW\*(C`DT_RUNPATH\*(C'\fR or
     1143\&\f(CW\*(C`DT_RPATH\*(C'\fR of a shared library are searched for shared
     1144libraries needed by it. The \f(CW\*(C`DT_RPATH\*(C'\fR entries are ignored if
     1145\&\f(CW\*(C`DT_RUNPATH\*(C'\fR entries exist.
     1146.IP "7." 4
     1147The default directories, normally \fI/lib\fR and \fI/usr/lib\fR.
     1148.IP "8." 4
     1149For a native linker on an \s-1ELF\s0 system, if the file \fI/etc/ld.so.conf\fR
     1150exists, the list of directories found in that file.
     1151.RE
     1152.RS 4
     1153.Sp
    8611154If the required shared library is not found, the linker will issue a
    8621155warning and continue with the link.
    863 
    864 .TP
    865 .B \-S
    866 Omits debugger symbol information (but not all symbols) from the output file.
    867 
    868 .TP
    869 .B \-s
    870 Omits all symbol information from the output file.
    871 
    872 .TP
    873 .B \-shared
    874 Create a shared library.  This is currently only supported on ELF and
    875 SunOS platforms (on SunOS it is not required, as the linker will
    876 automatically create a shared library when there are undefined symbols
    877 and the
    878 .B \-e
    879 option is not used).
    880 
    881 .TP
    882 .B \-sort\-common
    883 Normally, when
    884 .B ld
    885 places the global common symbols in the appropriate output sections,
    886 it sorts them by size.  First come all the one byte symbols, then all
    887 the two bytes, then all the four bytes, and then everything else.
    888 This is to prevent gaps between symbols due to
    889 alignment constraints.  This option disables that sorting.
    890 
    891 .TP
    892 .B \-split\-by\-reloc\ \fIcount
    893 Trys to creates extra sections in the output file so that no single
    894 output section in the file contains more than
    895 .I count
    896 relocations.
    897 This is useful when generating huge relocatable for downloading into
    898 certain real time kernels with the COFF object file format; since COFF
    899 cannot represent more than 65535 relocations in a single section.
    900 Note that this will fail to work with object file formats which do not
     1156.RE
     1157.IP "\fB\-shared\fR" 4
     1158.IX Item "-shared"
     1159.PD 0
     1160.IP "\fB\-Bshareable\fR" 4
     1161.IX Item "-Bshareable"
     1162.PD
     1163Create a shared library.  This is currently only supported on \s-1ELF\s0, \s-1XCOFF\s0
     1164and SunOS platforms.  On SunOS, the linker will automatically create a
     1165shared library if the \fB\-e\fR option is not used and there are
     1166undefined symbols in the link.
     1167.IP "\fB\-\-sort\-common\fR" 4
     1168.IX Item "--sort-common"
     1169This option tells \fBld\fR to sort the common symbols by size when it
     1170places them in the appropriate output sections.  First come all the one
     1171byte symbols, then all the two byte, then all the four byte, and then
     1172everything else.  This is to prevent gaps between symbols due to
     1173alignment constraints.
     1174.IP "\fB\-\-split\-by\-file [\fR\fIsize\fR\fB]\fR" 4
     1175.IX Item "--split-by-file [size]"
     1176Similar to \fB\-\-split\-by\-reloc\fR but creates a new output section for
     1177each input file when \fIsize\fR is reached.  \fIsize\fR defaults to a
     1178size of 1 if not given.
     1179.IP "\fB\-\-split\-by\-reloc [\fR\fIcount\fR\fB]\fR" 4
     1180.IX Item "--split-by-reloc [count]"
     1181Tries to creates extra sections in the output file so that no single
     1182output section in the file contains more than \fIcount\fR relocations.
     1183This is useful when generating huge relocatable files for downloading into
     1184certain real time kernels with the \s-1COFF\s0 object file format; since \s-1COFF\s0
     1185cannot represent more than 65535 relocations in a single section.  Note
     1186that this will fail to work with object file formats which do not
    9011187support arbitrary sections.  The linker will not split up individual
    902 input sections for redistribution, so if a single input section
    903 contains more than
    904 .I count
    905 relocations one output section will contain that many relocations.
    906 
    907 .TP
    908 .B \-split\-by\-file
    909 Similar to
    910 .B \-split\-by\-reloc
    911 but creates a new output section for each input file.
    912 
    913 .TP
    914 .BI "--section-start " "sectionname" "\fR=\fP"org
     1188input sections for redistribution, so if a single input section contains
     1189more than \fIcount\fR relocations one output section will contain that
     1190many relocations.  \fIcount\fR defaults to a value of 32768.
     1191.IP "\fB\-\-stats\fR" 4
     1192.IX Item "--stats"
     1193Compute and display statistics about the operation of the linker, such
     1194as execution time and memory usage.
     1195.IP "\fB\-\-traditional\-format\fR" 4
     1196.IX Item "--traditional-format"
     1197For some targets, the output of \fBld\fR is different in some ways from
     1198the output of some existing linker.  This switch requests \fBld\fR to
     1199use the traditional format instead.
     1200.Sp
     1201For example, on SunOS, \fBld\fR combines duplicate entries in the
     1202symbol string table.  This can reduce the size of an output file with
     1203full debugging information by over 30 percent.  Unfortunately, the SunOS
     1204\&\f(CW\*(C`dbx\*(C'\fR program can not read the resulting program (\f(CW\*(C`gdb\*(C'\fR has no
     1205trouble).  The \fB\-\-traditional\-format\fR switch tells \fBld\fR to not
     1206combine duplicate entries.
     1207.IP "\fB\-\-section\-start\fR \fIsectionname\fR\fB=\fR\fIorg\fR" 4
     1208.IX Item "--section-start sectionname=org"
    9151209Locate a section in the output file at the absolute
    916 address given by \c
    917 .I org\c
    918 \&.  \c
    919 \c
    920 .I org\c
    921 \& must be a hexadecimal integer.
    922 You may use this option as many
     1210address given by \fIorg\fR.  You may use this option as many
    9231211times as necessary to locate multiple sections in the command
    924 line.  If you need more elaborate expressions, consider
    925 using the linker command language from a script.
    926 
    927 .TP
    928 .BI "\-Tbss " "org"\c
    929 .TP
    930 .BI "\-Tdata " "org"\c
    931 .TP
    932 .BI "\-Ttext " "org"\c
    933 Use \c
    934 .I org\c
    935 \& as the starting address for\(em\&respectively\(em\&the
    936 \c
    937 .B bss\c
    938 \&, \c
    939 .B data\c
    940 \&, or the \c
    941 .B text\c
    942 \& segment of the output file.
    943 \c
    944 .I org\c
    945 \& must be a hexadecimal integer.
    946 
    947 .TP
    948 .BI "\-T " "commandfile"
    949 Equivalent to \c
    950 .B \-c \c
    951 .I commandfile\c
    952 \&\c
    953 \&; supported for compatibility with
    954 other tools. 
    955 
    956 .TP
    957 .B \-t
    958 Prints names of input files as \c
    959 .B ld\c
    960 \& processes them.
    961 
    962 .TP
    963 .BI "\-u " "sym"
    964 Forces \c
    965 .I sym\c
    966 \& to be entered in the output file as an undefined symbol.
    967 This may, for example, trigger linking of additional modules from
    968 standard libraries.  \c
    969 .B \-u\c
    970 \& may be repeated with different option
    971 arguments to enter additional undefined symbols.
    972 
    973 .TP
    974 .B \-Ur
    975 For anything other than C++ programs, this option is equivalent to
    976 \c
    977 .B \-r\c
    978 \&: it generates relocatable output\(em\&i.e., an output file that can in
    979 turn serve as input to \c
    980 .B ld\c
    981 \&.  When linking C++ programs, \c
    982 .B \-Ur
    983 .I will\c
    984 \& resolve references to constructors, unlike \c
    985 .B \-r\c
    986 \&.
    987 
    988 .TP
    989 .B \-\-verbose
    990 Display the version number for \c
    991 .B ld
    992 and list the supported emulations.
    993 Display which input files can and can not be opened.
    994 
    995 .TP
    996 .B \-v, \-V
    997 Display the version number for \c
    998 .B ld\c
    999 \&.
    1000 The
    1001 .B \-V
    1002 option also lists the supported emulations.
    1003 
    1004 .TP
    1005 .B \-\-version
    1006 Display the version number for \c
    1007 .B ld
    1008 and exit.
    1009 
    1010 .TP
    1011 .B \-warn\-common
     1212line.
     1213\&\fIorg\fR must be a single hexadecimal integer;
     1214for compatibility with other linkers, you may omit the leading
     1215\&\fB0x\fR usually associated with hexadecimal values.  \fINote:\fR there
     1216should be no white space between \fIsectionname\fR, the equals
     1217sign (``\fB=\fR''), and \fIorg\fR.
     1218.IP "\fB\-Tbss\fR \fIorg\fR" 4
     1219.IX Item "-Tbss org"
     1220.PD 0
     1221.IP "\fB\-Tdata\fR \fIorg\fR" 4
     1222.IX Item "-Tdata org"
     1223.IP "\fB\-Ttext\fR \fIorg\fR" 4
     1224.IX Item "-Ttext org"
     1225.PD
     1226Same as \-\-section\-start, with \f(CW\*(C`.bss\*(C'\fR, \f(CW\*(C`.data\*(C'\fR or
     1227\&\f(CW\*(C`.text\*(C'\fR as the \fIsectionname\fR.
     1228.IP "\fB\-\-dll\-verbose\fR" 4
     1229.IX Item "--dll-verbose"
     1230.PD 0
     1231.IP "\fB\-\-verbose\fR" 4
     1232.IX Item "--verbose"
     1233.PD
     1234Display the version number for \fBld\fR and list the linker emulations
     1235supported.  Display which input files can and cannot be opened.  Display
     1236the linker script being used by the linker.
     1237.IP "\fB\-\-version\-script=\fR\fIversion-scriptfile\fR" 4
     1238.IX Item "--version-script=version-scriptfile"
     1239Specify the name of a version script to the linker.  This is typically
     1240used when creating shared libraries to specify additional information
     1241about the version hierarchy for the library being created.  This option
     1242is only meaningful on \s-1ELF\s0 platforms which support shared libraries.
     1243.IP "\fB\-\-warn\-common\fR" 4
     1244.IX Item "--warn-common"
    10121245Warn when a common symbol is combined with another common symbol or with
    10131246a symbol definition.  Unix linkers allow this somewhat sloppy practice,
    10141247but linkers on some other operating systems do not.  This option allows
    10151248you to find potential problems from combining global symbols.
    1016 
    1017 .TP
    1018 .B \-warn\-constructors
    1019 Warn if any global constructors are used.  This is only useful for a
    1020 few object file formats.  For formats like COFF or ELF, the linker can
    1021 not detect the use of global constructors.
    1022 
    1023 .TP
    1024 .B \-warn\-multiple\-gp
    1025 Warn if the output file requires multiple global-pointer values.  This
    1026 option is only meaningful for certain processors, such as the Alpha.
    1027 
    1028 .TP
    1029 .B \-warn\-once
     1249Unfortunately, some C libraries use this practice, so you may get some
     1250warnings about symbols in the libraries as well as in your programs.
     1251.Sp
     1252There are three kinds of global symbols, illustrated here by C examples:
     1253.RS 4
     1254.IP "\fBint i = 1;\fR" 4
     1255.IX Item "int i = 1;"
     1256A definition, which goes in the initialized data section of the output
     1257file.
     1258.IP "\fBextern int i;\fR" 4
     1259.IX Item "extern int i;"
     1260An undefined reference, which does not allocate space.
     1261There must be either a definition or a common symbol for the
     1262variable somewhere.
     1263.IP "\fBint i;\fR" 4
     1264.IX Item "int i;"
     1265A common symbol.  If there are only (one or more) common symbols for a
     1266variable, it goes in the uninitialized data area of the output file.
     1267The linker merges multiple common symbols for the same variable into a
     1268single symbol.  If they are of different sizes, it picks the largest
     1269size.  The linker turns a common symbol into a declaration, if there is
     1270a definition of the same variable.
     1271.RE
     1272.RS 4
     1273.Sp
     1274The \fB\-\-warn\-common\fR option can produce five kinds of warnings.
     1275Each warning consists of a pair of lines: the first describes the symbol
     1276just encountered, and the second describes the previous symbol
     1277encountered with the same name.  One or both of the two symbols will be
     1278a common symbol.
     1279.IP "1." 4
     1280Turning a common symbol into a reference, because there is already a
     1281definition for the symbol.
     1282.Sp
     1283.Vb 3
     1284\&        <file>(<section>): warning: common of `<symbol>'
     1285\&           overridden by definition
     1286\&        <file>(<section>): warning: defined here
     1287.Ve
     1288.IP "2." 4
     1289Turning a common symbol into a reference, because a later definition for
     1290the symbol is encountered.  This is the same as the previous case,
     1291except that the symbols are encountered in a different order.
     1292.Sp
     1293.Vb 3
     1294\&        <file>(<section>): warning: definition of `<symbol>'
     1295\&           overriding common
     1296\&        <file>(<section>): warning: common is here
     1297.Ve
     1298.IP "3." 4
     1299Merging a common symbol with a previous same-sized common symbol.
     1300.Sp
     1301.Vb 3
     1302\&        <file>(<section>): warning: multiple common
     1303\&           of `<symbol>'
     1304\&        <file>(<section>): warning: previous common is here
     1305.Ve
     1306.IP "4." 4
     1307Merging a common symbol with a previous larger common symbol.
     1308.Sp
     1309.Vb 3
     1310\&        <file>(<section>): warning: common of `<symbol>'
     1311\&           overridden by larger common
     1312\&        <file>(<section>): warning: larger common is here
     1313.Ve
     1314.IP "5." 4
     1315Merging a common symbol with a previous smaller common symbol.  This is
     1316the same as the previous case, except that the symbols are
     1317encountered in a different order.
     1318.Sp
     1319.Vb 3
     1320\&        <file>(<section>): warning: common of `<symbol>'
     1321\&           overriding smaller common
     1322\&        <file>(<section>): warning: smaller common is here
     1323.Ve
     1324.RE
     1325.RS 4
     1326.RE
     1327.IP "\fB\-\-warn\-constructors\fR" 4
     1328.IX Item "--warn-constructors"
     1329Warn if any global constructors are used.  This is only useful for a few
     1330object file formats.  For formats like \s-1COFF\s0 or \s-1ELF\s0, the linker can not
     1331detect the use of global constructors.
     1332.IP "\fB\-\-warn\-multiple\-gp\fR" 4
     1333.IX Item "--warn-multiple-gp"
     1334Warn if multiple global pointer values are required in the output file.
     1335This is only meaningful for certain processors, such as the Alpha.
     1336Specifically, some processors put large-valued constants in a special
     1337section.  A special register (the global pointer) points into the middle
     1338of this section, so that constants can be loaded efficiently via a
     1339base-register relative addressing mode.  Since the offset in
     1340base-register relative mode is fixed and relatively small (e.g., 16
     1341bits), this limits the maximum size of the constant pool.  Thus, in
     1342large programs, it is often necessary to use multiple global pointer
     1343values in order to be able to address all possible constants.  This
     1344option causes a warning to be issued whenever this case occurs.
     1345.IP "\fB\-\-warn\-once\fR" 4
     1346.IX Item "--warn-once"
    10301347Only warn once for each undefined symbol, rather than once per module
    10311348which refers to it.
    1032 
    1033 .TP
    1034 .B \-warn\-section\-align
     1349.IP "\fB\-\-warn\-section\-align\fR" 4
     1350.IX Item "--warn-section-align"
    10351351Warn if the address of an output section is changed because of
    10361352alignment.  Typically, the alignment will be set by an input section.
    10371353The address will only be changed if it not explicitly specified; that
    1038 is, if the SECTIONS command does not specify a start address for the
    1039 section.
    1040 
    1041 .TP
    1042 .B \-\-whole\-archive
     1354is, if the \f(CW\*(C`SECTIONS\*(C'\fR command does not specify a start address for
     1355the section.
     1356.IP "\fB\-\-whole\-archive\fR" 4
     1357.IX Item "--whole-archive"
    10431358For each archive mentioned on the command line after the
    1044 .B \-\-whole\-archive
    1045 option, include every object file in the archive in the link, rather
    1046 than searching the archive for the required object files.  This is
    1047 normally used to turn an archive file into a shared library, forcing
    1048 every object to be included in the resulting shared library.
    1049 
    1050 .TP
    1051 .B \-\-no\-whole\-archive
    1052 Turn off the effect of the
    1053 .B \-\-whole\-archive
    1054 option for archives which appear later on the command line.
    1055 
    1056 .TP
    1057 .BI "--wrap " "symbol"
    1058 Use a wrapper function for
    1059 .I symbol.
    1060 Any undefined reference to
    1061 .I symbol
    1062 will be resolved to
    1063 .BI "__wrap_" "symbol".
    1064 Any undefined reference to
    1065 .BI "__real_" "symbol"
    1066 will be resolved to
    1067 .I symbol.
    1068 
    1069 .TP
    1070 .B \-X
    1071 Delete all temporary local symbols.  For most targets, this is all local
    1072 symbols whose names begin with `\|\c
    1073 .B L\c
    1074 \|'.
    1075 
    1076 .TP
    1077 .B \-x
    1078 Delete all local symbols.
    1079 
    1080 .PP
    1081 
    1082 .SH ENVIRONMENT
    1083 \c
    1084 You can change the behavior of
    1085 .B ld\c
    1086 \& with the environment variable \c
    1087 .B GNUTARGET\c
    1088 \&.
    1089 
    1090 \c
    1091 .B GNUTARGET\c
    1092 \& determines the input-file object format if you don't
    1093 use \c
    1094 .B \-b\c
    1095 \& (or its synonym \c
    1096 .B \-format\c
    1097 \&).  Its value should be one
    1098 of the BFD names for an input format.  If there is no
    1099 \c
    1100 .B GNUTARGET\c
    1101 \& in the environment, \c
    1102 .B ld\c
    1103 \& uses the natural format
    1104 of the host. If \c
    1105 .B GNUTARGET\c
    1106 \& is set to \c
    1107 .B default\c
    1108 \& then BFD attempts to discover the
    1109 input format by examining binary input files; this method often
    1110 succeeds, but there are potential ambiguities, since there is no method
    1111 of ensuring that the magic number used to flag object-file formats is
    1112 unique.  However, the configuration procedure for BFD on each system
    1113 places the conventional format for that system first in the search-list,
    1114 so ambiguities are resolved in favor of convention.
    1115 
    1116 .PP
    1117 
     1359\&\fB\-\-whole\-archive\fR option, include every object file in the archive
     1360in the link, rather than searching the archive for the required object
     1361files.  This is normally used to turn an archive file into a shared
     1362library, forcing every object to be included in the resulting shared
     1363library.  This option may be used more than once.
     1364.Sp
     1365Two notes when using this option from gcc: First, gcc doesn't know
     1366about this option, so you have to use \fB\-Wl,\-whole\-archive\fR.
     1367Second, don't forget to use \fB\-Wl,\-no\-whole\-archive\fR after your
     1368list of archives, because gcc will add its own list of archives to
     1369your link and you may not want this flag to affect those as well.
     1370.IP "\fB\-\-wrap\fR \fIsymbol\fR" 4
     1371.IX Item "--wrap symbol"
     1372Use a wrapper function for \fIsymbol\fR.  Any undefined reference to
     1373\&\fIsymbol\fR will be resolved to \f(CW\*(C`_\|_wrap_\f(CIsymbol\f(CW\*(C'\fR.  Any
     1374undefined reference to \f(CW\*(C`_\|_real_\f(CIsymbol\f(CW\*(C'\fR will be resolved to
     1375\&\fIsymbol\fR.
     1376.Sp
     1377This can be used to provide a wrapper for a system function.  The
     1378wrapper function should be called \f(CW\*(C`_\|_wrap_\f(CIsymbol\f(CW\*(C'\fR.  If it
     1379wishes to call the system function, it should call
     1380\&\f(CW\*(C`_\|_real_\f(CIsymbol\f(CW\*(C'\fR.
     1381.Sp
     1382Here is a trivial example:
     1383.Sp
     1384.Vb 6
     1385\&        void *
     1386\&        __wrap_malloc (int c)
     1387\&        {
     1388\&          printf ("malloc called with %ld\en", c);
     1389\&          return __real_malloc (c);
     1390\&        }
     1391.Ve
     1392.Sp
     1393If you link other code with this file using \fB\-\-wrap malloc\fR, then
     1394all calls to \f(CW\*(C`malloc\*(C'\fR will call the function \f(CW\*(C`_\|_wrap_malloc\*(C'\fR
     1395instead.  The call to \f(CW\*(C`_\|_real_malloc\*(C'\fR in \f(CW\*(C`_\|_wrap_malloc\*(C'\fR will
     1396call the real \f(CW\*(C`malloc\*(C'\fR function.
     1397.Sp
     1398You may wish to provide a \f(CW\*(C`_\|_real_malloc\*(C'\fR function as well, so that
     1399links without the \fB\-\-wrap\fR option will succeed.  If you do this,
     1400you should not put the definition of \f(CW\*(C`_\|_real_malloc\*(C'\fR in the same
     1401file as \f(CW\*(C`_\|_wrap_malloc\*(C'\fR; if you do, the assembler may resolve the
     1402call before the linker has a chance to wrap it to \f(CW\*(C`malloc\*(C'\fR.
     1403.IP "\fB\-\-enable\-new\-dtags\fR" 4
     1404.IX Item "--enable-new-dtags"
     1405.PD 0
     1406.IP "\fB\-\-disable\-new\-dtags\fR" 4
     1407.IX Item "--disable-new-dtags"
     1408.PD
     1409This linker can create the new dynamic tags in \s-1ELF\s0. But the older \s-1ELF\s0
     1410systems may not understand them. If you specify
     1411\&\fB\-\-enable\-new\-dtags\fR, the dynamic tags will be created as needed.
     1412If you specify \fB\-\-disable\-new\-dtags\fR, no new dynamic tags will be
     1413created. By default, the new dynamic tags are not created. Note that
     1414those options are only available for \s-1ELF\s0 systems.
     1415.PP
     1416The i386 \s-1PE\s0 linker supports the \fB\-shared\fR option, which causes
     1417the output to be a dynamically linked library (\s-1DLL\s0) instead of a
     1418normal executable.  You should name the output \f(CW\*(C`*.dll\*(C'\fR when you
     1419use this option.  In addition, the linker fully supports the standard
     1420\&\f(CW\*(C`*.def\*(C'\fR files, which may be specified on the linker command line
     1421like an object file (in fact, it should precede archives it exports
     1422symbols from, to ensure that they get linked in, just like a normal
     1423object file).
     1424.PP
     1425In addition to the options common to all targets, the i386 \s-1PE\s0 linker
     1426support additional command line options that are specific to the i386
     1427\&\s-1PE\s0 target.  Options that take values may be separated from their
     1428values by either a space or an equals sign.
     1429.IP "\fB\-\-add\-stdcall\-alias\fR" 4
     1430.IX Item "--add-stdcall-alias"
     1431If given, symbols with a stdcall suffix (@\fInn\fR) will be exported
     1432as-is and also with the suffix stripped.
     1433[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1434.IP "\fB\-\-base\-file\fR \fIfile\fR" 4
     1435.IX Item "--base-file file"
     1436Use \fIfile\fR as the name of a file in which to save the base
     1437addresses of all the relocations needed for generating DLLs with
     1438\&\fIdlltool\fR.
     1439[This is an i386 \s-1PE\s0 specific option]
     1440.IP "\fB\-\-dll\fR" 4
     1441.IX Item "--dll"
     1442Create a \s-1DLL\s0 instead of a regular executable.  You may also use
     1443\&\fB\-shared\fR or specify a \f(CW\*(C`LIBRARY\*(C'\fR in a given \f(CW\*(C`.def\*(C'\fR
     1444file.
     1445[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1446.IP "\fB\-\-enable\-stdcall\-fixup\fR" 4
     1447.IX Item "--enable-stdcall-fixup"
     1448.PD 0
     1449.IP "\fB\-\-disable\-stdcall\-fixup\fR" 4
     1450.IX Item "--disable-stdcall-fixup"
     1451.PD
     1452If the link finds a symbol that it cannot resolve, it will attempt to
     1453do ``fuzzy linking'' by looking for another defined symbol that differs
     1454only in the format of the symbol name (cdecl vs stdcall) and will
     1455resolve that symbol by linking to the match.  For example, the
     1456undefined symbol \f(CW\*(C`_foo\*(C'\fR might be linked to the function
     1457\&\f(CW\*(C`_foo@12\*(C'\fR, or the undefined symbol \f(CW\*(C`_bar@16\*(C'\fR might be linked
     1458to the function \f(CW\*(C`_bar\*(C'\fR.  When the linker does this, it prints a
     1459warning, since it normally should have failed to link, but sometimes
     1460import libraries generated from third-party dlls may need this feature
     1461to be usable.  If you specify \fB\-\-enable\-stdcall\-fixup\fR, this
     1462feature is fully enabled and warnings are not printed.  If you specify
     1463\&\fB\-\-disable\-stdcall\-fixup\fR, this feature is disabled and such
     1464mismatches are considered to be errors.
     1465[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1466.IP "\fB\-\-export\-all\-symbols\fR" 4
     1467.IX Item "--export-all-symbols"
     1468If given, all global symbols in the objects used to build a \s-1DLL\s0 will
     1469be exported by the \s-1DLL\s0.  Note that this is the default if there
     1470otherwise wouldn't be any exported symbols.  When symbols are
     1471explicitly exported via \s-1DEF\s0 files or implicitly exported via function
     1472attributes, the default is to not export anything else unless this
     1473option is given.  Note that the symbols \f(CW\*(C`DllMain@12\*(C'\fR,
     1474\&\f(CW\*(C`DllEntryPoint@0\*(C'\fR, \f(CW\*(C`DllMainCRTStartup@12\*(C'\fR, and
     1475\&\f(CW\*(C`impure_ptr\*(C'\fR will not be automatically
     1476exported.  Also, symbols imported from other DLLs will not be
     1477re\-exported, nor will symbols specifying the \s-1DLL\s0's internal layout
     1478such as those beginning with \f(CW\*(C`_head_\*(C'\fR or ending with
     1479\&\f(CW\*(C`_iname\*(C'\fR.  In addition, no symbols from \f(CW\*(C`libgcc\*(C'\fR,
     1480\&\f(CW\*(C`libstd++\*(C'\fR, \f(CW\*(C`libmingw32\*(C'\fR, or \f(CW\*(C`crtX.o\*(C'\fR will be exported.
     1481Symbols whose names begin with \f(CW\*(C`_\|_rtti_\*(C'\fR or \f(CW\*(C`_\|_builtin_\*(C'\fR will
     1482not be exported, to help with \*(C+ DLLs.  Finally, there is an
     1483extensive list of cygwin-private symbols that are not exported
     1484(obviously, this applies on when building DLLs for cygwin targets).
     1485These cygwin-excludes are: \f(CW\*(C`_cygwin_dll_entry@12\*(C'\fR,
     1486\&\f(CW\*(C`_cygwin_crt0_common@8\*(C'\fR, \f(CW\*(C`_cygwin_noncygwin_dll_entry@12\*(C'\fR,
     1487\&\f(CW\*(C`_fmode\*(C'\fR, \f(CW\*(C`_impure_ptr\*(C'\fR, \f(CW\*(C`cygwin_attach_dll\*(C'\fR,
     1488\&\f(CW\*(C`cygwin_premain0\*(C'\fR, \f(CW\*(C`cygwin_premain1\*(C'\fR, \f(CW\*(C`cygwin_premain2\*(C'\fR,
     1489\&\f(CW\*(C`cygwin_premain3\*(C'\fR, and \f(CW\*(C`environ\*(C'\fR.
     1490[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1491.IP "\fB\-\-exclude\-symbols\fR \fIsymbol\fR\fB,\fR\fIsymbol\fR\fB,...\fR" 4
     1492.IX Item "--exclude-symbols symbol,symbol,..."
     1493Specifies a list of symbols which should not be automatically
     1494exported.  The symbol names may be delimited by commas or colons.
     1495[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1496.IP "\fB\-\-exclude\-libs\fR \fIlib\fR\fB,\fR\fIlib\fR\fB,...\fR" 4
     1497.IX Item "--exclude-libs lib,lib,..."
     1498Specifies a list of archive libraries from which symbols should not be automatically
     1499exported. The library names may be delimited by commas or colons.  Specifying
     1500\&\f(CW\*(C`\-\-exclude\-libs ALL\*(C'\fR excludes symbols in all archive libraries from
     1501automatic export. Symbols explicitly listed in a .def file are still exported,
     1502regardless of this option.
     1503[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1504.IP "\fB\-\-file\-alignment\fR" 4
     1505.IX Item "--file-alignment"
     1506Specify the file alignment.  Sections in the file will always begin at
     1507file offsets which are multiples of this number.  This defaults to
     1508512.
     1509[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1510.IP "\fB\-\-heap\fR \fIreserve\fR" 4
     1511.IX Item "--heap reserve"
     1512.PD 0
     1513.IP "\fB\-\-heap\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4
     1514.IX Item "--heap reserve,commit"
     1515.PD
     1516Specify the amount of memory to reserve (and optionally commit) to be
     1517used as heap for this program.  The default is 1Mb reserved, 4K
     1518committed.
     1519[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1520.IP "\fB\-\-image\-base\fR \fIvalue\fR" 4
     1521.IX Item "--image-base value"
     1522Use \fIvalue\fR as the base address of your program or dll.  This is
     1523the lowest memory location that will be used when your program or dll
     1524is loaded.  To reduce the need to relocate and improve performance of
     1525your dlls, each should have a unique base address and not overlap any
     1526other dlls.  The default is 0x400000 for executables, and 0x10000000
     1527for dlls.
     1528[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1529.IP "\fB\-\-kill\-at\fR" 4
     1530.IX Item "--kill-at"
     1531If given, the stdcall suffixes (@\fInn\fR) will be stripped from
     1532symbols before they are exported.
     1533[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1534.IP "\fB\-\-major\-image\-version\fR \fIvalue\fR" 4
     1535.IX Item "--major-image-version value"
     1536Sets the major number of the ``image version''.  Defaults to 1.
     1537[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1538.IP "\fB\-\-major\-os\-version\fR \fIvalue\fR" 4
     1539.IX Item "--major-os-version value"
     1540Sets the major number of the ``os version''.  Defaults to 4.
     1541[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1542.IP "\fB\-\-major\-subsystem\-version\fR \fIvalue\fR" 4
     1543.IX Item "--major-subsystem-version value"
     1544Sets the major number of the ``subsystem version''.  Defaults to 4.
     1545[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1546.IP "\fB\-\-minor\-image\-version\fR \fIvalue\fR" 4
     1547.IX Item "--minor-image-version value"
     1548Sets the minor number of the ``image version''.  Defaults to 0.
     1549[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1550.IP "\fB\-\-minor\-os\-version\fR \fIvalue\fR" 4
     1551.IX Item "--minor-os-version value"
     1552Sets the minor number of the ``os version''.  Defaults to 0.
     1553[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1554.IP "\fB\-\-minor\-subsystem\-version\fR \fIvalue\fR" 4
     1555.IX Item "--minor-subsystem-version value"
     1556Sets the minor number of the ``subsystem version''.  Defaults to 0.
     1557[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1558.IP "\fB\-\-output\-def\fR \fIfile\fR" 4
     1559.IX Item "--output-def file"
     1560The linker will create the file \fIfile\fR which will contain a \s-1DEF\s0
     1561file corresponding to the \s-1DLL\s0 the linker is generating.  This \s-1DEF\s0 file
     1562(which should be called \f(CW\*(C`*.def\*(C'\fR) may be used to create an import
     1563library with \f(CW\*(C`dlltool\*(C'\fR or may be used as a reference to
     1564automatically or implicitly exported symbols.
     1565[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1566.IP "\fB\-\-out\-implib\fR \fIfile\fR" 4
     1567.IX Item "--out-implib file"
     1568The linker will create the file \fIfile\fR which will contain an
     1569import lib corresponding to the \s-1DLL\s0 the linker is generating. This
     1570import lib (which should be called \f(CW\*(C`*.dll.a\*(C'\fR or \f(CW\*(C`*.a\*(C'\fR
     1571may be used to link clients against the generated \s-1DLL\s0; this behavior
     1572makes it possible to skip a separate \f(CW\*(C`dlltool\*(C'\fR import library
     1573creation step.
     1574[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1575.IP "\fB\-\-enable\-auto\-image\-base\fR" 4
     1576.IX Item "--enable-auto-image-base"
     1577Automatically choose the image base for DLLs, unless one is specified
     1578using the \f(CW\*(C`\-\-image\-base\*(C'\fR argument.  By using a hash generated
     1579from the dllname to create unique image bases for each \s-1DLL\s0, in-memory
     1580collisions and relocations which can delay program execution are
     1581avoided.
     1582[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1583.IP "\fB\-\-disable\-auto\-image\-base\fR" 4
     1584.IX Item "--disable-auto-image-base"
     1585Do not automatically generate a unique image base.  If there is no
     1586user-specified image base (\f(CW\*(C`\-\-image\-base\*(C'\fR) then use the platform
     1587default.
     1588[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1589.IP "\fB\-\-dll\-search\-prefix\fR \fIstring\fR" 4
     1590.IX Item "--dll-search-prefix string"
     1591When linking dynamically to a dll without an import library,
     1592search for \f(CW\*(C`<string><basename>.dll\*(C'\fR in preference to
     1593\&\f(CW\*(C`lib<basename>.dll\*(C'\fR. This behavior allows easy distinction
     1594between DLLs built for the various \*(L"subplatforms\*(R": native, cygwin,
     1595uwin, pw, etc.  For instance, cygwin DLLs typically use
     1596\&\f(CW\*(C`\-\-dll\-search\-prefix=cyg\*(C'\fR.
     1597[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1598.IP "\fB\-\-enable\-auto\-import\fR" 4
     1599.IX Item "--enable-auto-import"
     1600Do sophisticated linking of \f(CW\*(C`_symbol\*(C'\fR to \f(CW\*(C`_\|_imp_\|_symbol\*(C'\fR for
     1601\&\s-1DATA\s0 imports from DLLs, and create the necessary thunking symbols when
     1602building the import libraries with those \s-1DATA\s0 exports.  This generally
     1603will 'just work' \*(-- but sometimes you may see this message:
     1604.Sp
     1605"variable '<var>' can't be auto\-imported. Please read the
     1606documentation for ld's \f(CW\*(C`\-\-enable\-auto\-import\*(C'\fR for details."
     1607.Sp
     1608This message occurs when some (sub)expression accesses an address
     1609ultimately given by the sum of two constants (Win32 import tables only
     1610allow one).  Instances where this may occur include accesses to member
     1611fields of struct variables imported from a \s-1DLL\s0, as well as using a
     1612constant index into an array variable imported from a \s-1DLL\s0.  Any
     1613multiword variable (arrays, structs, long long, etc) may trigger
     1614this error condition.  However, regardless of the exact data type
     1615of the offending exported variable, ld will always detect it, issue
     1616the warning, and exit.
     1617.Sp
     1618There are several ways to address this difficulty, regardless of the
     1619data type of the exported variable:
     1620.Sp
     1621One way is to use \-\-enable\-runtime\-pseudo\-reloc switch. This leaves the task
     1622of adjusting references in your client code for runtime environment, so
     1623this method works only when runtime environtment supports this feature.
     1624.Sp
     1625A second solution is to force one of the 'constants' to be a variable \*(--
     1626that is, unknown and un-optimizable at compile time.  For arrays,
     1627there are two possibilities: a) make the indexee (the array's address)
     1628a variable, or b) make the 'constant' index a variable.  Thus:
     1629.Sp
     1630.Vb 3
     1631\&        extern type extern_array[];
     1632\&        extern_array[1] -->
     1633\&           { volatile type *t=extern_array; t[1] }
     1634.Ve
     1635.Sp
     1636or
     1637.Sp
     1638.Vb 3
     1639\&        extern type extern_array[];
     1640\&        extern_array[1] -->
     1641\&           { volatile int t=1; extern_array[t] }
     1642.Ve
     1643.Sp
     1644For structs (and most other multiword data types) the only option
     1645is to make the struct itself (or the long long, or the ...) variable:
     1646.Sp
     1647.Vb 3
     1648\&        extern struct s extern_struct;
     1649\&        extern_struct.field -->
     1650\&           { volatile struct s *t=&extern_struct; t->field }
     1651.Ve
     1652.Sp
     1653or
     1654.Sp
     1655.Vb 3
     1656\&        extern long long extern_ll;
     1657\&        extern_ll -->
     1658\&          { volatile long long * local_ll=&extern_ll; *local_ll }
     1659.Ve
     1660.Sp
     1661A third method of dealing with this difficulty is to abandon
     1662\&'auto\-import' for the offending symbol and mark it with
     1663\&\f(CW\*(C`_\|_declspec(dllimport)\*(C'\fR.  However, in practice that
     1664requires using compile-time #defines to indicate whether you are
     1665building a \s-1DLL\s0, building client code that will link to the \s-1DLL\s0, or
     1666merely building/linking to a static library.   In making the choice
     1667between the various methods of resolving the 'direct address with
     1668constant offset' problem, you should consider typical real-world usage:
     1669.Sp
     1670Original:
     1671.Sp
     1672.Vb 7
     1673\&        --foo.h
     1674\&        extern int arr[];
     1675\&        --foo.c
     1676\&        #include "foo.h"
     1677\&        void main(int argc, char **argv){
     1678\&          printf("%d\en",arr[1]);
     1679\&        }
     1680.Ve
     1681.Sp
     1682Solution 1:
     1683.Sp
     1684.Vb 9
     1685\&        --foo.h
     1686\&        extern int arr[];
     1687\&        --foo.c
     1688\&        #include "foo.h"
     1689\&        void main(int argc, char **argv){
     1690\&          /* This workaround is for win32 and cygwin; do not "optimize" */
     1691\&          volatile int *parr = arr;
     1692\&          printf("%d\en",parr[1]);
     1693\&        }
     1694.Ve
     1695.Sp
     1696Solution 2:
     1697.Sp
     1698.Vb 14
     1699\&        --foo.h
     1700\&        /* Note: auto-export is assumed (no __declspec(dllexport)) */
     1701\&        #if (defined(_WIN32) || defined(__CYGWIN__)) && \e
     1702\&          !(defined(FOO_BUILD_DLL) || defined(FOO_STATIC))
     1703\&        #define FOO_IMPORT __declspec(dllimport)
     1704\&        #else
     1705\&        #define FOO_IMPORT
     1706\&        #endif
     1707\&        extern FOO_IMPORT int arr[];
     1708\&        --foo.c
     1709\&        #include "foo.h"
     1710\&        void main(int argc, char **argv){
     1711\&          printf("%d\en",arr[1]);
     1712\&        }
     1713.Ve
     1714.Sp
     1715A fourth way to avoid this problem is to re-code your
     1716library to use a functional interface rather than a data interface
     1717for the offending variables (e.g. \fIset_foo()\fR and \fIget_foo()\fR accessor
     1718functions).
     1719[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1720.IP "\fB\-\-disable\-auto\-import\fR" 4
     1721.IX Item "--disable-auto-import"
     1722Do not attempt to do sophisticalted linking of \f(CW\*(C`_symbol\*(C'\fR to
     1723\&\f(CW\*(C`_\|_imp_\|_symbol\*(C'\fR for \s-1DATA\s0 imports from DLLs.
     1724[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1725.IP "\fB\-\-enable\-runtime\-pseudo\-reloc\fR" 4
     1726.IX Item "--enable-runtime-pseudo-reloc"
     1727If your code contains expressions described in \-\-enable\-auto\-import section,
     1728that is, \s-1DATA\s0 imports from \s-1DLL\s0 with non-zero offset, this switch will create
     1729a vector of 'runtime pseudo relocations' which can be used by runtime
     1730environment to adjust references to such data in your client code.
     1731[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1732.IP "\fB\-\-disable\-runtime\-pseudo\-reloc\fR" 4
     1733.IX Item "--disable-runtime-pseudo-reloc"
     1734Do not create pseudo relocations for non-zero offset \s-1DATA\s0 imports from
     1735DLLs.  This is the default.
     1736[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1737.IP "\fB\-\-enable\-extra\-pe\-debug\fR" 4
     1738.IX Item "--enable-extra-pe-debug"
     1739Show additional debug info related to auto-import symbol thunking.
     1740[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1741.IP "\fB\-\-section\-alignment\fR" 4
     1742.IX Item "--section-alignment"
     1743Sets the section alignment.  Sections in memory will always begin at
     1744addresses which are a multiple of this number.  Defaults to 0x1000.
     1745[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1746.IP "\fB\-\-stack\fR \fIreserve\fR" 4
     1747.IX Item "--stack reserve"
     1748.PD 0
     1749.IP "\fB\-\-stack\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4
     1750.IX Item "--stack reserve,commit"
     1751.PD
     1752Specify the amount of memory to reserve (and optionally commit) to be
     1753used as stack for this program.  The default is 2Mb reserved, 4K
     1754committed.
     1755[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1756.IP "\fB\-\-subsystem\fR \fIwhich\fR" 4
     1757.IX Item "--subsystem which"
     1758.PD 0
     1759.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR" 4
     1760.IX Item "--subsystem which:major"
     1761.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR\fB.\fR\fIminor\fR" 4
     1762.IX Item "--subsystem which:major.minor"
     1763.PD
     1764Specifies the subsystem under which your program will execute.  The
     1765legal values for \fIwhich\fR are \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`windows\*(C'\fR,
     1766\&\f(CW\*(C`console\*(C'\fR, and \f(CW\*(C`posix\*(C'\fR.  You may optionally set the
     1767subsystem version also.
     1768[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
     1769.SH "ENVIRONMENT"
     1770.IX Header "ENVIRONMENT"
     1771You can change the behavior of \fBld\fR with the environment variables
     1772\&\f(CW\*(C`GNUTARGET\*(C'\fR,
     1773\&\f(CW\*(C`LDEMULATION\*(C'\fR and \f(CW\*(C`COLLECT_NO_DEMANGLE\*(C'\fR.
     1774.PP
     1775\&\f(CW\*(C`GNUTARGET\*(C'\fR determines the input-file object format if you don't
     1776use \fB\-b\fR (or its synonym \fB\-\-format\fR).  Its value should be one
     1777of the \s-1BFD\s0 names for an input format.  If there is no
     1778\&\f(CW\*(C`GNUTARGET\*(C'\fR in the environment, \fBld\fR uses the natural format
     1779of the target. If \f(CW\*(C`GNUTARGET\*(C'\fR is set to \f(CW\*(C`default\*(C'\fR then \s-1BFD\s0
     1780attempts to discover the input format by examining binary input files;
     1781this method often succeeds, but there are potential ambiguities, since
     1782there is no method of ensuring that the magic number used to specify
     1783object-file formats is unique.  However, the configuration procedure for
     1784\&\s-1BFD\s0 on each system places the conventional format for that system first
     1785in the search\-list, so ambiguities are resolved in favor of convention.
     1786.PP
     1787\&\f(CW\*(C`LDEMULATION\*(C'\fR determines the default emulation if you don't use the
     1788\&\fB\-m\fR option.  The emulation can affect various aspects of linker
     1789behaviour, particularly the default linker script.  You can list the
     1790available emulations with the \fB\-\-verbose\fR or \fB\-V\fR options.  If
     1791the \fB\-m\fR option is not used, and the \f(CW\*(C`LDEMULATION\*(C'\fR environment
     1792variable is not defined, the default emulation depends upon how the
     1793linker was configured.
     1794.PP
     1795Normally, the linker will default to demangling symbols.  However, if
     1796\&\f(CW\*(C`COLLECT_NO_DEMANGLE\*(C'\fR is set in the environment, then it will
     1797default to not demangling symbols.  This environment variable is used in
     1798a similar fashion by the \f(CW\*(C`gcc\*(C'\fR linker wrapper program.  The default
     1799may be overridden by the \fB\-\-demangle\fR and \fB\-\-no\-demangle\fR
     1800options.
    11181801.SH "SEE ALSO"
    1119 
    1120 .BR objdump ( 1 )
    1121 .br
    1122 .br
    1123 .RB "`\|" ld "\|' and `\|" binutils "\|'"
    1124 entries in
    1125 .B info\c
    1126 .br
    1127 .I
    1128 ld: the GNU linker\c
    1129 , Steve Chamberlain and Roland Pesch;
    1130 .I
    1131 The GNU Binary Utilities\c
    1132 , Roland H. Pesch.
    1133 
    1134 .SH COPYING
    1135 Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 1998, 2000 Free Software Foundation, Inc.
    1136 .PP
    1137 This document is distributed under the terms of the GNU Free
    1138 Documentation License, version 1.1.  That license is described in the
    1139 sources for this manual page, but it is not displayed here in order to
    1140 make this manual more consise.  Copies of this license can also be
    1141 obtained from: http://www.gnu.org/copyleft/.
    1142 
    1143 \"  .SH GNU Free Documentation License
    1144 \"    Version 1.1, March 2000
    1145 
    1146 \"    Copyright (C) 2000  Free Software Foundation, Inc.
    1147 \"    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1148      
    1149 \"    Everyone is permitted to copy and distribute verbatim
    1150 \"    copies of this license document, but changing it is
    1151 \"    not allowed.
    1152 \"  .PP
    1153 \"  0. PREAMBLE
    1154 \"  .PP
    1155 \"  The purpose of this License is to make a manual, textbook, or other
    1156 \"  written document "free" in the sense of freedom: to assure everyone
    1157 \"  the effective freedom to copy and redistribute it, with or without
    1158 \"  modifying it, either commercially or noncommercially.  Secondarily,
    1159 \"  this License preserves for the author and publisher a way to get
    1160 \"  credit for their work, while not being considered responsible for
    1161 \"  modifications made by others.
    1162 \"  .PP
    1163 \"  This License is a kind of "copyleft", which means that derivative
    1164 \"  works of the document must themselves be free in the same sense.  It
    1165 \"  complements the GNU General Public License, which is a copyleft
    1166 \"  license designed for free software.
    1167 \"  .PP
    1168 \"  We have designed this License in order to use it for manuals for free
    1169 \"  software, because free software needs free documentation: a free
    1170 \"  program should come with manuals providing the same freedoms that the
    1171 \"  software does.  But this License is not limited to software manuals;
    1172 \"  it can be used for any textual work, regardless of subject matter or
    1173 \"  whether it is published as a printed book.  We recommend this License
    1174 \"  principally for works whose purpose is instruction or reference.
    1175 \"  .PP
    1176 \"  1. APPLICABILITY AND DEFINITIONS
    1177 \"  .PP
    1178 \"  This License applies to any manual or other work that contains a
    1179 \"  notice placed by the copyright holder saying it can be distributed
    1180 \"  under the terms of this License.  The "Document", below, refers to any
    1181 \"  such manual or work.  Any member of the public is a licensee, and is
    1182 \"  addressed as "you".
    1183 \"  .PP
    1184 \"  A "Modified Version" of the Document means any work containing the
    1185 \"  Document or a portion of it, either copied verbatim, or with
    1186 \"  modifications and/or translated into another language.
    1187 \"  .PP
    1188 \"  A "Secondary Section" is a named appendix or a front-matter section of
    1189 \"  the Document that deals exclusively with the relationship of the
    1190 \"  publishers or authors of the Document to the Document's overall subject
    1191 \"  (or to related matters) and contains nothing that could fall directly
    1192 \"  within that overall subject.  (For example, if the Document is in part a
    1193 \"  textbook of mathematics, a Secondary Section may not explain any
    1194 \"  mathematics.)  The relationship could be a matter of historical
    1195 \"  connection with the subject or with related matters, or of legal,
    1196 \"  commercial, philosophical, ethical or political position regarding
    1197 \"  them.
    1198 \"  .PP
    1199 \"  The "Invariant Sections" are certain Secondary Sections whose titles
    1200 \"  are designated, as being those of Invariant Sections, in the notice
    1201 \"  that says that the Document is released under this License.
    1202 \"  .PP
    1203 \"  The "Cover Texts" are certain short passages of text that are listed,
    1204 \"  as Front-Cover Texts or Back-Cover Texts, in the notice that says that
    1205 \"  the Document is released under this License.
    1206 \"  .PP
    1207 \"  A "Transparent" copy of the Document means a machine-readable copy,
    1208 \"  represented in a format whose specification is available to the
    1209 \"  general public, whose contents can be viewed and edited directly and
    1210 \"  straightforwardly with generic text editors or (for images composed of
    1211 \"  pixels) generic paint programs or (for drawings) some widely available
    1212 \"  drawing editor, and that is suitable for input to text formatters or
    1213 \"  for automatic translation to a variety of formats suitable for input
    1214 \"  to text formatters.  A copy made in an otherwise Transparent file
    1215 \"  format whose markup has been designed to thwart or discourage
    1216 \"  subsequent modification by readers is not Transparent.  A copy that is
    1217 \"  not "Transparent" is called "Opaque".
    1218 \"  .PP
    1219 \"  Examples of suitable formats for Transparent copies include plain
    1220 \"  ASCII without markup, Texinfo input format, LaTeX input format, SGML
    1221 \"  or XML using a publicly available DTD, and standard-conforming simple
    1222 \"  HTML designed for human modification.  Opaque formats include
    1223 \"  PostScript, PDF, proprietary formats that can be read and edited only
    1224 \"  by proprietary word processors, SGML or XML for which the DTD and/or
    1225 \"  processing tools are not generally available, and the
    1226 \"  machine-generated HTML produced by some word processors for output
    1227 \"  purposes only.
    1228 \"  .PP
    1229 \"  The "Title Page" means, for a printed book, the title page itself,
    1230 \"  plus such following pages as are needed to hold, legibly, the material
    1231 \"  this License requires to appear in the title page.  For works in
    1232 \"  formats which do not have any title page as such, "Title Page" means
    1233 \"  the text near the most prominent appearance of the work's title,
    1234 \"  preceding the beginning of the body of the text.
    1235 \"  .PP
    1236 \"  2. VERBATIM COPYING
    1237 \"  .PP
    1238 \"  You may copy and distribute the Document in any medium, either
    1239 \"  commercially or noncommercially, provided that this License, the
    1240 \"  copyright notices, and the license notice saying this License applies
    1241 \"  to the Document are reproduced in all copies, and that you add no other
    1242 \"  conditions whatsoever to those of this License.  You may not use
    1243 \"  technical measures to obstruct or control the reading or further
    1244 \"  copying of the copies you make or distribute.  However, you may accept
    1245 \"  compensation in exchange for copies.  If you distribute a large enough
    1246 \"  number of copies you must also follow the conditions in section 3.
    1247 \"  .PP
    1248 \"  You may also lend copies, under the same conditions stated above, and
    1249 \"  you may publicly display copies.
    1250 \"  .PP
    1251 \"  3. COPYING IN QUANTITY
    1252 \"  .PP
    1253 \"  If you publish printed copies of the Document numbering more than 100,
    1254 \"  and the Document's license notice requires Cover Texts, you must enclose
    1255 \"  the copies in covers that carry, clearly and legibly, all these Cover
    1256 \"  Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
    1257 \"  the back cover.  Both covers must also clearly and legibly identify
    1258 \"  you as the publisher of these copies.  The front cover must present
    1259 \"  the full title with all words of the title equally prominent and
    1260 \"  visible.  You may add other material on the covers in addition.
    1261 \"  Copying with changes limited to the covers, as long as they preserve
    1262 \"  the title of the Document and satisfy these conditions, can be treated
    1263 \"  as verbatim copying in other respects.
    1264 \"  .PP
    1265 \"  If the required texts for either cover are too voluminous to fit
    1266 \"  legibly, you should put the first ones listed (as many as fit
    1267 \"  reasonably) on the actual cover, and continue the rest onto adjacent
    1268 \"  pages.
    1269 \"  .PP
    1270 \"  If you publish or distribute Opaque copies of the Document numbering
    1271 \"  more than 100, you must either include a machine-readable Transparent
    1272 \"  copy along with each Opaque copy, or state in or with each Opaque copy
    1273 \"  a publicly-accessible computer-network location containing a complete
    1274 \"  Transparent copy of the Document, free of added material, which the
    1275 \"  general network-using public has access to download anonymously at no
    1276 \"  charge using public-standard network protocols.  If you use the latter
    1277 \"  option, you must take reasonably prudent steps, when you begin
    1278 \"  distribution of Opaque copies in quantity, to ensure that this
    1279 \"  Transparent copy will remain thus accessible at the stated location
    1280 \"  until at least one year after the last time you distribute an Opaque
    1281 \"  copy (directly or through your agents or retailers) of that edition to
    1282 \"  the public.
    1283 \"  .PP
    1284 \"  It is requested, but not required, that you contact the authors of the
    1285 \"  Document well before redistributing any large number of copies, to give
    1286 \"  them a chance to provide you with an updated version of the Document.
    1287 \"  .PP
    1288 \"  4. MODIFICATIONS
    1289 \"  .PP
    1290 \"  You may copy and distribute a Modified Version of the Document under
    1291 \"  the conditions of sections 2 and 3 above, provided that you release
    1292 \"  the Modified Version under precisely this License, with the Modified
    1293 \"  Version filling the role of the Document, thus licensing distribution
    1294 \"  and modification of the Modified Version to whoever possesses a copy
    1295 \"  of it.  In addition, you must do these things in the Modified Version:
    1296 \"  .PP
    1297 \"  A. Use in the Title Page (and on the covers, if any) a title distinct
    1298 \"  from that of the Document, and from those of previous versions
    1299 \"  (which should, if there were any, be listed in the History section
    1300 \"  of the Document).  You may use the same title as a previous version
    1301 \"  if the original publisher of that version gives permission.
    1302 \"  .PP
    1303 \"  B. List on the Title Page, as authors, one or more persons or entities
    1304 \"  responsible for authorship of the modifications in the Modified
    1305 \"  Version, together with at least five of the principal authors of the
    1306 \"  Document (all of its principal authors, if it has less than five).
    1307 \"  .PP
    1308 \"  C. State on the Title page the name of the publisher of the
    1309 \"  Modified Version, as the publisher.
    1310 \"  .PP
    1311 \"  D. Preserve all the copyright notices of the Document.
    1312 \"  .PP
    1313 \"  E. Add an appropriate copyright notice for your modifications
    1314 \"  adjacent to the other copyright notices.
    1315 \"  .PP
    1316 \"  F. Include, immediately after the copyright notices, a license notice
    1317 \"  giving the public permission to use the Modified Version under the
    1318 \"  terms of this License, in the form shown in the Addendum below.
    1319 \"  Preserve in that license notice the full lists of Invariant Sections
    1320 \"  and required Cover Texts given in the Document's license notice.
    1321 \"  .PP
    1322 \"  H. Include an unaltered copy of this License.
    1323 \"  .PP
    1324 \"  I. Preserve the section entitled "History", and its title, and add to
    1325 \"  it an item stating at least the title, year, new authors, and
    1326 \"  publisher of the Modified Version as given on the Title Page.  If
    1327 \"  there is no section entitled "History" in the Document, create one
    1328 \"  stating the title, year, authors, and publisher of the Document as
    1329 \"  given on its Title Page, then add an item describing the Modified
    1330 \"  Version as stated in the previous sentence.
    1331 \"  .PP
    1332 \"  J. Preserve the network location, if any, given in the Document for
    1333 \"  public access to a Transparent copy of the Document, and likewise
    1334 \"  the network locations given in the Document for previous versions
    1335 \"  it was based on.  These may be placed in the "History" section.
    1336 \"  You may omit a network location for a work that was published at
    1337 \"  least four years before the Document itself, or if the original
    1338 \"  publisher of the version it refers to gives permission.
    1339 \"  .PP
    1340 \"  K. In any section entitled "Acknowledgements" or "Dedications",
    1341 \"  preserve the section's title, and preserve in the section all the
    1342 \"  substance and tone of each of the contributor acknowledgements
    1343 \"  and/or dedications given therein.
    1344 \"  .PP
    1345 \"  L. Preserve all the Invariant Sections of the Document,
    1346 \"  unaltered in their text and in their titles.  Section numbers
    1347 \"  or the equivalent are not considered part of the section titles.
    1348 \"  .PP
    1349 \"  M. Delete any section entitled "Endorsements".  Such a section
    1350 \"  may not be included in the Modified Version.
    1351 \"  .PP
    1352 \"  N. Do not retitle any existing section as "Endorsements"
    1353 \"  or to conflict in title with any Invariant Section.
    1354 \"  .PP
    1355 \"  If the Modified Version includes new front-matter sections or
    1356 \"  appendices that qualify as Secondary Sections and contain no material
    1357 \"  copied from the Document, you may at your option designate some or all
    1358 \"  of these sections as invariant.  To do this, add their titles to the
    1359 \"  list of Invariant Sections in the Modified Version's license notice.
    1360 \"  These titles must be distinct from any other section titles.
    1361 \"  .PP
    1362 \"  You may add a section entitled "Endorsements", provided it contains
    1363 \"  nothing but endorsements of your Modified Version by various
    1364 \"  parties--for example, statements of peer review or that the text has
    1365 \"  been approved by an organization as the authoritative definition of a
    1366 \"  standard.
    1367 \"  .PP
    1368 \"  You may add a passage of up to five words as a Front-Cover Text, and a
    1369 \"  passage of up to 25 words as a Back-Cover Text, to the end of the list
    1370 \"  of Cover Texts in the Modified Version.  Only one passage of
    1371 \"  Front-Cover Text and one of Back-Cover Text may be added by (or
    1372 \"  through arrangements made by) any one entity.  If the Document already
    1373 \"  includes a cover text for the same cover, previously added by you or
    1374 \"  by arrangement made by the same entity you are acting on behalf of,
    1375 \"  you may not add another; but you may replace the old one, on explicit
    1376 \"  permission from the previous publisher that added the old one.
    1377 \"  .PP
    1378 \"  The author(s) and publisher(s) of the Document do not by this License
    1379 \"  give permission to use their names for publicity for or to assert or
    1380 \"  imply endorsement of any Modified Version.
    1381 \"  .PP
    1382 
    1383 \"  5. COMBINING DOCUMENTS
    1384 \"  .PP
    1385 \"  You may combine the Document with other documents released under this
    1386 \"  License, under the terms defined in section 4 above for modified
    1387 \"  versions, provided that you include in the combination all of the
    1388 \"  Invariant Sections of all of the original documents, unmodified, and
    1389 \"  list them all as Invariant Sections of your combined work in its
    1390 \"  license notice.
    1391 \"  .PP
    1392 \"  The combined work need only contain one copy of this License, and
    1393 \"  multiple identical Invariant Sections may be replaced with a single
    1394 \"  copy.  If there are multiple Invariant Sections with the same name but
    1395 \"  different contents, make the title of each such section unique by
    1396 \"  adding at the end of it, in parentheses, the name of the original
    1397 \"  author or publisher of that section if known, or else a unique number.
    1398 \"  Make the same adjustment to the section titles in the list of
    1399 \"  Invariant Sections in the license notice of the combined work.
    1400 \"  .PP
    1401 \"  In the combination, you must combine any sections entitled "History"
    1402 \"  in the various original documents, forming one section entitled
    1403 \"  "History"; likewise combine any sections entitled "Acknowledgements",
    1404 \"  and any sections entitled "Dedications".  You must delete all sections
    1405 \"  entitled "Endorsements."
    1406 \"  .PP
    1407 
    1408 \"  6. COLLECTIONS OF DOCUMENTS
    1409 \"  .PP
    1410 \"  You may make a collection consisting of the Document and other documents
    1411 \"  released under this License, and replace the individual copies of this
    1412 \"  License in the various documents with a single copy that is included in
    1413 \"  the collection, provided that you follow the rules of this License for
    1414 \"  verbatim copying of each of the documents in all other respects.
    1415 \"  .PP
    1416 \"  You may extract a single document from such a collection, and distribute
    1417 \"  it individually under this License, provided you insert a copy of this
    1418 \"  License into the extracted document, and follow this License in all
    1419 \"  other respects regarding verbatim copying of that document.
    1420 \"  .PP
    1421 
    1422 \"  7. AGGREGATION WITH INDEPENDENT WORKS
    1423 \"  .PP
    1424 \"  A compilation of the Document or its derivatives with other separate
    1425 \"  and independent documents or works, in or on a volume of a storage or
    1426 \"  distribution medium, does not as a whole count as a Modified Version
    1427 \"  of the Document, provided no compilation copyright is claimed for the
    1428 \"  compilation.  Such a compilation is called an "aggregate", and this
    1429 \"  License does not apply to the other self-contained works thus compiled
    1430 \"  with the Document, on account of their being thus compiled, if they
    1431 \"  are not themselves derivative works of the Document.
    1432 \"  .PP
    1433 \"  If the Cover Text requirement of section 3 is applicable to these
    1434 \"  copies of the Document, then if the Document is less than one quarter
    1435 \"  of the entire aggregate, the Document's Cover Texts may be placed on
    1436 \"  covers that surround only the Document within the aggregate.
    1437 \"  Otherwise they must appear on covers around the whole aggregate.
    1438 \"  .PP
    1439 
    1440 \"  8. TRANSLATION
    1441 \"  .PP
    1442 \"  Translation is considered a kind of modification, so you may
    1443 \"  distribute translations of the Document under the terms of section 4.
    1444 \"  Replacing Invariant Sections with translations requires special
    1445 \"  permission from their copyright holders, but you may include
    1446 \"  translations of some or all Invariant Sections in addition to the
    1447 \"  original versions of these Invariant Sections.  You may include a
    1448 \"  translation of this License provided that you also include the
    1449 \"  original English version of this License.  In case of a disagreement
    1450 \"  between the translation and the original English version of this
    1451 \"  License, the original English version will prevail.
    1452 \"  .PP
    1453 
    1454 \"  9. TERMINATION
    1455 \"  .PP
    1456 \"  You may not copy, modify, sublicense, or distribute the Document except
    1457 \"  as expressly provided for under this License.  Any other attempt to
    1458 \"  copy, modify, sublicense or distribute the Document is void, and will
    1459 \"  automatically terminate your rights under this License.  However,
    1460 \"  parties who have received copies, or rights, from you under this
    1461 \"  License will not have their licenses terminated so long as such
    1462 \"  parties remain in full compliance.
    1463 \"  .PP
    1464 
    1465 \"  10. FUTURE REVISIONS OF THIS LICENSE
    1466 \"  .PP
    1467 \"  The Free Software Foundation may publish new, revised versions
    1468 \"  of the GNU Free Documentation License from time to time.  Such new
    1469 \"  versions will be similar in spirit to the present version, but may
    1470 \"  differ in detail to address new problems or concerns.  See
    1471 \"  http://www.gnu.org/copyleft/.
    1472 \"  .PP
    1473 \"  Each version of the License is given a distinguishing version number.
    1474 \"  If the Document specifies that a particular numbered version of this
    1475 \"  License "or any later version" applies to it, you have the option of
    1476 \"  following the terms and conditions either of that specified version or
    1477 \"  of any later version that has been published (not as a draft) by the
    1478 \"  Free Software Foundation.  If the Document does not specify a version
    1479 \"  number of this License, you may choose any version ever published (not
    1480 \"  as a draft) by the Free Software Foundation.
    1481 \"  .PP
    1482 
    1483 \"  ADDENDUM: How to use this License for your documents
    1484 \"  .PP
    1485 \"  To use this License in a document you have written, include a copy of
    1486 \"  the License in the document and put the following copyright and
    1487 \"  license notices just after the title page:
    1488 \"  .PP
    1489 \"      Copyright (c)  YEAR  YOUR NAME.
    1490 \"      Permission is granted to copy, distribute and/or
    1491 \"      modify this document under the terms of the GNU
    1492 \"      Free Documentation License, Version 1.1 or any later
    1493 \"      version published by the Free Software Foundation;
    1494 \"      with the Invariant Sections being LIST THEIR TITLES,
    1495 \"      with the Front-Cover Texts being LIST, and with the
    1496 \"      Back-Cover Texts being LIST.  A copy of the license
    1497 \"      is included in the section entitled "GNU Free
    1498 \"      Documentation License".
    1499 \"  .PP
    1500 \"  If you have no Invariant Sections, write "with no Invariant Sections"
    1501 \"  instead of saying which ones are invariant.  If you have no
    1502 \"  Front-Cover Texts, write "no Front-Cover Texts" instead of
    1503 \"  "Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
    1504 \"  .PP
    1505 \"  If your document contains nontrivial examples of program code, we
    1506 \"  recommend releasing these examples in parallel under your choice of
    1507 \"  free software license, such as the GNU General Public License,
    1508 \"  to permit their use in free software.
     1802.IX Header "SEE ALSO"
     1803\&\fIar\fR\|(1), \fInm\fR\|(1), \fIobjcopy\fR\|(1), \fIobjdump\fR\|(1), \fIreadelf\fR\|(1) and
     1804the Info entries for \fIbinutils\fR and
     1805\&\fIld\fR.
     1806.SH "COPYRIGHT"
     1807.IX Header "COPYRIGHT"
     1808Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
     18092002, 2003 Free Software Foundation, Inc.
     1810.PP
     1811Permission is granted to copy, distribute and/or modify this document
     1812under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1
     1813or any later version published by the Free Software Foundation;
     1814with no Invariant Sections, with no Front-Cover Texts, and with no
     1815Back-Cover Texts.  A copy of the license is included in the
     1816section entitled ``\s-1GNU\s0 Free Documentation License''.
Note: See TracChangeset for help on using the changeset viewer.