| 1 | .\" Copyright (c) 1991, 1992 Free Software Foundation |
| 2 | .\" See section COPYING for conditions for redistribution |
| 3 | .TH ld 1 "17 August 1992" "cygnus support" "GNU Development Tools" |
| 4 | .de BP |
| 5 | .sp |
| 6 | .ti \-.2i |
| 7 | \(** |
| 8 | .. |
| 9 | |
| 10 | .SH NAME |
| 11 | ld \- the GNU linker |
| 12 | |
| 13 | .SH SYNOPSIS |
| 14 | .hy 0 |
| 15 | .na |
| 16 | .TP |
| 17 | .B ld |
| 18 | .RB "[\|" \-o " |
| 19 | .I output\c |
| 20 | \&\|] \c |
| 21 | .I objfile\c |
| 22 | \&.\|.\|. |
| 23 | .br |
| 24 | .RB "[\|" \-A\c |
| 25 | .I architecture\c |
| 26 | \&\|] |
| 27 | .RB "[\|" "\-b\ "\c |
| 28 | .I input-format\c |
| 29 | \&\|] |
| 30 | .RB "[\|" \-Bstatic "\|]" |
| 31 | .RB "[\|" "\-c\ "\c |
| 32 | .I commandfile\c |
| 33 | \&\|] |
| 34 | .RB "[\|" \-d | \-dc | \-dp\c |
| 35 | \|] |
| 36 | .br |
| 37 | .RB "[\|" "\-defsym\ "\c |
| 38 | .I symbol\c |
| 39 | \& = \c |
| 40 | .I expression\c |
| 41 | \&\|] |
| 42 | .RB "[\|" "\-e\ "\c |
| 43 | .I entry\c |
| 44 | \&\|] |
| 45 | .RB "[\|" \-F "\|]" |
| 46 | .RB "[\|" "\-F\ "\c |
| 47 | .I format\c |
| 48 | \&\|] |
| 49 | .RB "[\|" "\-format\ "\c |
| 50 | .I input-format\c |
| 51 | \&\|] |
| 52 | .RB "[\|" \-g "\|]" |
| 53 | .RB "[\|" \-G\c |
| 54 | .I size\c |
| 55 | \&\|] |
| 56 | .RB "[\|" \-i "\|]" |
| 57 | .RB "[\|" \-l\c |
| 58 | .I ar\c |
| 59 | \&\|] |
| 60 | .RB "[\|" \-L\c |
| 61 | .I searchdir\c |
| 62 | \&\|] |
| 63 | .RB "[\|" \-M "\|]" |
| 64 | .RB "[\|" \-Map\c |
| 65 | .I mapfile\c |
| 66 | \&\|] |
| 67 | .RB "[\|" \-m\c |
| 68 | .I emulation\c |
| 69 | \&\|] |
| 70 | .RB "[\|" \-n | \-N "\|]" |
| 71 | .RB "[\|" \-noinhibit-exec "\|]" |
| 72 | .RB "[\|" "\-oformat\ "\c |
| 73 | .I output-format\c |
| 74 | \&\|] |
| 75 | .RB "[\|" "\-R\ "\c |
| 76 | .I filename\c |
| 77 | \&\|] |
| 78 | .RB "[\|" \-relax "\|]" |
| 79 | .RB "[\|" \-r | \-Ur "\|]" |
| 80 | .RB "[\|" \-S "\|]" |
| 81 | .RB "[\|" \-s "\|]" |
| 82 | .RB "[\|" "\-T\ "\c |
| 83 | .I commandfile\c |
| 84 | \&\|] |
| 85 | .RB "[\|" "\-Ttext\ "\c |
| 86 | .I textorg\c |
| 87 | \&\|] |
| 88 | .RB "[\|" "\-Tdata\ "\c |
| 89 | .I dataorg\c |
| 90 | \&\|] |
| 91 | .RB "[\|" "\-Tbss\ "\c |
| 92 | .I bssorg\c |
| 93 | \&\|] |
| 94 | .RB "[\|" \-t "\|]" |
| 95 | .RB "[\|" "\-u\ "\c |
| 96 | .I sym\c |
| 97 | \&] |
| 98 | .RB "[\|" \-V "\|]" |
| 99 | .RB "[\|" \-v "\|]" |
| 100 | .RB "[\|" \-X "\|]" |
| 101 | .RB "[\|" \-x "\|]" |
| 102 | .ad b |
| 103 | .hy 1 |
| 104 | .SH DESCRIPTION |
| 105 | \c |
| 106 | .B ld\c |
| 107 | \& combines a number of object and archive files, relocates |
| 108 | their data and ties up symbol references. Often the last step in |
| 109 | building a new compiled program to run is a call to \c |
| 110 | .B ld\c |
| 111 | \&. |
| 112 | |
| 113 | \c |
| 114 | .B ld\c |
| 115 | \& accepts Linker Command Language files |
| 116 | to provide explicit and total control over the linking process. |
| 117 | This man page does not describe the command language; see the `\|\c |
| 118 | .B ld\c |
| 119 | \|' entry in `\|\c |
| 120 | .B info\c |
| 121 | \|', or the manual |
| 122 | .I |
| 123 | ld: the GNU linker |
| 124 | \&, for full details on the command language and on other aspects of |
| 125 | the GNU linker. |
| 126 | |
| 127 | This version of \c |
| 128 | .B ld\c |
| 129 | \& uses the general purpose BFD libraries |
| 130 | to operate on object files. This allows \c |
| 131 | .B ld\c |
| 132 | \& to read, combine, and |
| 133 | write object files in many different formats\(em\&for example, COFF or |
| 134 | \c |
| 135 | .B a.out\c |
| 136 | \&. Different formats may be linked together to produce any |
| 137 | available kind of object file. You can use `\|\c |
| 138 | .B objdump \-i\c |
| 139 | \|' to get a list of formats supported on various architectures; see |
| 140 | .BR objdump ( 1 ). |
| 141 | |
| 142 | Aside from its flexibility, the GNU linker is more helpful than other |
| 143 | linkers in providing diagnostic information. Many linkers abandon |
| 144 | execution immediately upon encountering an error; whenever possible, |
| 145 | \c |
| 146 | .B ld\c |
| 147 | \& continues executing, allowing you to identify other errors |
| 148 | (or, in some cases, to get an output file in spite of the error). |
| 149 | |
| 150 | The GNU linker \c |
| 151 | .B ld\c |
| 152 | \& is meant to cover a broad range of situations, |
| 153 | and to be as compatible as possible with other linkers. As a result, |
| 154 | you have many choices to control its behavior through the command line, |
| 155 | and through environment variables. |
| 156 | |
| 157 | .SH OPTIONS |
| 158 | The plethora of command-line options may seem intimidating, but in |
| 159 | actual practice few of them are used in any particular context. |
| 160 | For instance, a frequent use of \c |
| 161 | .B ld\c |
| 162 | \& is to link standard Unix |
| 163 | object files on a standard, supported Unix system. On such a system, to |
| 164 | link a file \c |
| 165 | .B hello.o\c |
| 166 | \&: |
| 167 | .sp |
| 168 | .br |
| 169 | $\ ld\ \-o\ output\ /lib/crt0.o\ hello.o\ \-lc |
| 170 | .br |
| 171 | .sp |
| 172 | This tells \c |
| 173 | .B ld\c |
| 174 | \& to produce a file called \c |
| 175 | .B output\c |
| 176 | \& as the |
| 177 | result of linking the file \c |
| 178 | .B /lib/crt0.o\c |
| 179 | \& with \c |
| 180 | .B hello.o\c |
| 181 | \& and |
| 182 | the library \c |
| 183 | .B libc.a\c |
| 184 | \& which will come from the standard search |
| 185 | directories. |
| 186 | |
| 187 | The command-line options to \c |
| 188 | .B ld\c |
| 189 | \& may be specified in any order, and |
| 190 | may be repeated at will. For the most part, repeating an option with a |
| 191 | different argument will either have no further effect, or override prior |
| 192 | occurrences (those further to the left on the command line) of an |
| 193 | option. |
| 194 | |
| 195 | The exceptions\(em\&which may meaningfully be used more than once\(em\&are |
| 196 | \c |
| 197 | .B \-A\c |
| 198 | \&, \c |
| 199 | .B \-b\c |
| 200 | \& (or its synonym \c |
| 201 | .B \-format\c |
| 202 | \&), \c |
| 203 | .B \-defsym\c |
| 204 | \&, |
| 205 | \c |
| 206 | .B \-L\c |
| 207 | \&, \c |
| 208 | .B \-l\c |
| 209 | \&, \c |
| 210 | .B \-R\c |
| 211 | \&, and \c |
| 212 | .B \-u\c |
| 213 | \&. |
| 214 | |
| 215 | The list of object files to be linked together, shown as \c |
| 216 | .I objfile\c |
| 217 | \&, |
| 218 | may follow, precede, or be mixed in with command-line options; save that |
| 219 | an \c |
| 220 | .I objfile\c |
| 221 | \& argument may not be placed between an option flag and |
| 222 | its argument. |
| 223 | |
| 224 | Usually the linker is invoked with at least one object file, but other |
| 225 | forms of binary input files can also be specified with \c |
| 226 | .B \-l\c |
| 227 | \&, |
| 228 | \c |
| 229 | .B \-R\c |
| 230 | \&, and the script command language. If \c |
| 231 | .I no\c |
| 232 | \& binary input |
| 233 | files at all are specified, the linker does not produce any output, and |
| 234 | issues the message `\|\c |
| 235 | .B No input files\c |
| 236 | \|'. |
| 237 | |
| 238 | Option arguments must either follow the option letter without intervening |
| 239 | whitespace, or be given as separate arguments immediately following the |
| 240 | option that requires them. |
| 241 | |
| 242 | .TP |
| 243 | .BI "-A" "architecture"\c |
| 244 | \& |
| 245 | In the current release of \c |
| 246 | .B ld\c |
| 247 | \&, this option is useful only for the |
| 248 | Intel 960 family of architectures. In that \c |
| 249 | .B ld\c |
| 250 | \& configuration, the |
| 251 | \c |
| 252 | .I architecture\c |
| 253 | \& argument is one of the two-letter names identifying |
| 254 | members of the 960 family; the option specifies the desired output |
| 255 | target, and warns of any incompatible instructions in the input files. |
| 256 | It also modifies the linker's search strategy for archive libraries, to |
| 257 | support the use of libraries specific to each particular |
| 258 | architecture, by including in the search loop names suffixed with the |
| 259 | string identifying the architecture. |
| 260 | |
| 261 | For example, if your \c |
| 262 | .B ld\c |
| 263 | \& command line included `\|\c |
| 264 | .B \-ACA\c |
| 265 | \|' as |
| 266 | well as `\|\c |
| 267 | .B \-ltry\c |
| 268 | \|', the linker would look (in its built-in search |
| 269 | paths, and in any paths you specify with \c |
| 270 | .B \-L\c |
| 271 | \&) for a library with |
| 272 | the names |
| 273 | .sp |
| 274 | .br |
| 275 | try |
| 276 | .br |
| 277 | libtry.a |
| 278 | .br |
| 279 | tryca |
| 280 | .br |
| 281 | libtryca.a |
| 282 | .br |
| 283 | .sp |
| 284 | |
| 285 | The first two possibilities would be considered in any event; the last |
| 286 | two are due to the use of `\|\c |
| 287 | .B \-ACA\c |
| 288 | \|'. |
| 289 | |
| 290 | Future releases of \c |
| 291 | .B ld\c |
| 292 | \& may support similar functionality for |
| 293 | other architecture families. |
| 294 | |
| 295 | You can meaningfully use \c |
| 296 | .B \-A\c |
| 297 | \& more than once on a command line, if |
| 298 | an architecture family allows combination of target architectures; each |
| 299 | use will add another pair of name variants to search for when \c |
| 300 | .B \-l\c |
| 301 | \& |
| 302 | specifies a library. |
| 303 | |
| 304 | .TP |
| 305 | .BI "-b " "input-format"\c |
| 306 | \& |
| 307 | Specify the binary format for input object files that follow this option |
| 308 | on the command line. You don't usually need to specify this, as |
| 309 | \c |
| 310 | .B ld\c |
| 311 | \& is configured to expect as a default input format the most |
| 312 | usual format on each machine. \c |
| 313 | .I input-format\c |
| 314 | \& is a text string, the |
| 315 | name of a particular format supported by the BFD libraries. |
| 316 | \c |
| 317 | .B \-format \c |
| 318 | .I input-format\c |
| 319 | \&\c |
| 320 | \& has the same effect, as does the script command |
| 321 | .BR TARGET . |
| 322 | |
| 323 | You may want to use this option if you are linking files with an unusual |
| 324 | binary format. You can also use \c |
| 325 | .B \-b\c |
| 326 | \& to switch formats explicitly (when |
| 327 | linking object files of different formats), by including |
| 328 | \c |
| 329 | .B \-b \c |
| 330 | .I input-format\c |
| 331 | \&\c |
| 332 | \& before each group of object files in a |
| 333 | particular format. |
| 334 | |
| 335 | The default format is taken from the environment variable |
| 336 | .B GNUTARGET\c |
| 337 | \&. You can also define the input |
| 338 | format from a script, using the command \c |
| 339 | .B TARGET\c |
| 340 | \&. |
| 341 | |
| 342 | .TP |
| 343 | .B \-Bstatic |
| 344 | This flag is accepted for command-line compatibility with the SunOS linker, |
| 345 | but has no effect on \c |
| 346 | .B ld\c |
| 347 | \&. |
| 348 | |
| 349 | .TP |
| 350 | .BI "-c " "commandfile"\c |
| 351 | \& |
| 352 | Directs \c |
| 353 | .B ld\c |
| 354 | \& to read link commands from the file |
| 355 | \c |
| 356 | .I commandfile\c |
| 357 | \&. These commands will completely override \c |
| 358 | .B ld\c |
| 359 | \&'s |
| 360 | default link format (rather than adding to it); \c |
| 361 | .I commandfile\c |
| 362 | \& must |
| 363 | specify everything necessary to describe the target format. |
| 364 | |
| 365 | |
| 366 | You may also include a script of link commands directly in the command |
| 367 | line by bracketing it between `\|\c |
| 368 | .B {\c |
| 369 | \|' and `\|\c |
| 370 | .B }\c |
| 371 | \|' characters. |
| 372 | |
| 373 | .TP |
| 374 | .B \-d |
| 375 | .TP |
| 376 | .B \-dc |
| 377 | .TP |
| 378 | .B \-dp |
| 379 | These three options are equivalent; multiple forms are supported for |
| 380 | compatibility with other linkers. Use any of them to make \c |
| 381 | .B ld\c |
| 382 | \& |
| 383 | assign space to common symbols even if a relocatable output file is |
| 384 | specified (\c |
| 385 | .B \-r\c |
| 386 | \&). The script command |
| 387 | \c |
| 388 | .B FORCE_COMMON_ALLOCATION\c |
| 389 | \& has the same effect. |
| 390 | |
| 391 | .TP |
| 392 | .BI "-defsym " "symbol"\c |
| 393 | \& = \c |
| 394 | .I expression\c |
| 395 | \& |
| 396 | Create a global symbol in the output file, containing the absolute |
| 397 | address given by \c |
| 398 | .I expression\c |
| 399 | \&. You may use this option as many |
| 400 | times as necessary to define multiple symbols in the command line. A |
| 401 | limited form of arithmetic is supported for the \c |
| 402 | .I expression\c |
| 403 | \& in this |
| 404 | context: you may give a hexadecimal constant or the name of an existing |
| 405 | symbol, or use \c |
| 406 | .B +\c |
| 407 | \& and \c |
| 408 | .B \-\c |
| 409 | \& to add or subtract hexadecimal |
| 410 | constants or symbols. If you need more elaborate expressions, consider |
| 411 | using the linker command language from a script. |
| 412 | |
| 413 | .TP |
| 414 | .BI "-e " "entry"\c |
| 415 | \& |
| 416 | Use \c |
| 417 | .I entry\c |
| 418 | \& as the explicit symbol for beginning execution of your |
| 419 | program, rather than the default entry point. for a |
| 420 | discussion of defaults and other ways of specifying the |
| 421 | entry point. |
| 422 | |
| 423 | .TP |
| 424 | .B \-F |
| 425 | .TP |
| 426 | .BI "-F" "format"\c |
| 427 | \& |
| 428 | Some older linkers used this option throughout a compilation toolchain |
| 429 | for specifying object-file format for both input and output object |
| 430 | files. \c |
| 431 | .B ld\c |
| 432 | \&'s mechanisms (the \c |
| 433 | .B \-b\c |
| 434 | \& or \c |
| 435 | .B \-format\c |
| 436 | \& options |
| 437 | for input files, the \c |
| 438 | .B TARGET\c |
| 439 | \& command in linker scripts for output |
| 440 | files, the \c |
| 441 | .B GNUTARGET\c |
| 442 | \& environment variable) are more flexible, but |
| 443 | but it accepts (and ignores) the \c |
| 444 | .B \-F\c |
| 445 | \& option flag for compatibility |
| 446 | with scripts written to call the old linker. |
| 447 | |
| 448 | .TP |
| 449 | .BI "-format " "input-format"\c |
| 450 | \& |
| 451 | Synonym for \c |
| 452 | .B \-b\c |
| 453 | \& \c |
| 454 | .I input-format\c |
| 455 | \&. |
| 456 | |
| 457 | .TP |
| 458 | .B \-g |
| 459 | Accepted, but ignored; provided for compatibility with other tools. |
| 460 | |
| 461 | .TP |
| 462 | .BI "\-G " "size"\c |
| 463 | Set the maximum size of objects to be optimized using the GP register |
| 464 | to |
| 465 | .I size |
| 466 | under MIPS ECOFF. Ignored for other object file formats. |
| 467 | |
| 468 | .TP |
| 469 | .B \-i |
| 470 | Perform an incremental link (same as option \c |
| 471 | .B \-r\c |
| 472 | \&). |
| 473 | |
| 474 | .TP |
| 475 | .BI "-l" "ar"\c |
| 476 | \& |
| 477 | Add an archive file \c |
| 478 | .I ar\c |
| 479 | \& to the list of files to link. This |
| 480 | option may be used any number of times. \c |
| 481 | .B ld\c |
| 482 | \& will search its |
| 483 | path-list for occurrences of \c |
| 484 | .B lib\c |
| 485 | .I ar\c |
| 486 | \&.a\c |
| 487 | \& for every \c |
| 488 | .I ar\c |
| 489 | \& |
| 490 | specified. |
| 491 | |
| 492 | .TP |
| 493 | .BI "-L" "searchdir"\c |
| 494 | \& |
| 495 | This command adds path \c |
| 496 | .I searchdir\c |
| 497 | \& to the list of paths that |
| 498 | \c |
| 499 | .B ld\c |
| 500 | \& will search for archive libraries. You may use this option |
| 501 | any number of times. |
| 502 | |
| 503 | The default set of paths searched (without being specified with |
| 504 | \c |
| 505 | .B \-L\c |
| 506 | \&) depends on what emulation mode \c |
| 507 | .B ld\c |
| 508 | \& is using, and in |
| 509 | some cases also on how it was configured. The |
| 510 | paths can also be specified in a link script with the \c |
| 511 | .B SEARCH_DIR\c |
| 512 | \& |
| 513 | command. |
| 514 | |
| 515 | .TP |
| 516 | .B \-M |
| 517 | Print (to the standard output file) a link map\(em\&diagnostic information |
| 518 | about where symbols are mapped by \c |
| 519 | .B ld\c |
| 520 | \&, and information on global |
| 521 | common storage allocation. |
| 522 | |
| 523 | .TP |
| 524 | .BI "\-Map " "mapfile"\c |
| 525 | Print to the file |
| 526 | .I mapfile |
| 527 | a link map\(em\&diagnostic information |
| 528 | about where symbols are mapped by \c |
| 529 | .B ld\c |
| 530 | \&, and information on global |
| 531 | common storage allocation. |
| 532 | |
| 533 | .TP |
| 534 | .BI "\-m " "emulation"\c |
| 535 | Emulate the |
| 536 | .I emulation |
| 537 | linker. You can list the available emulations with the |
| 538 | .I \-V |
| 539 | option. This option overrides the compiled-in default, which is the |
| 540 | system for which you configured |
| 541 | .BR ld . |
| 542 | |
| 543 | .TP |
| 544 | .B \-N |
| 545 | specifies readable and writable \c |
| 546 | .B text\c |
| 547 | \& and \c |
| 548 | .B data\c |
| 549 | \& sections. If |
| 550 | the output format supports Unix style magic numbers, the output is |
| 551 | marked as \c |
| 552 | .B OMAGIC\c |
| 553 | \&. |
| 554 | |
| 555 | When you use the `\|\c |
| 556 | .B \-N\c |
| 557 | \&\|' option, the linker does not page-align the |
| 558 | data segment. |
| 559 | |
| 560 | .TP |
| 561 | .B \-n |
| 562 | sets the text segment to be read only, and \c |
| 563 | .B NMAGIC\c |
| 564 | \& is written |
| 565 | if possible. |
| 566 | |
| 567 | .TP |
| 568 | .B \-noinhibit-exec |
| 569 | Normally, the linker will not produce an output file if it encounters |
| 570 | errors during the link process. With this flag, you can specify that |
| 571 | you wish the output file retained even after non-fatal errors. |
| 572 | |
| 573 | .TP |
| 574 | .BI "-o " "output"\c |
| 575 | \& |
| 576 | .I output\c |
| 577 | \& |
| 578 | \c |
| 579 | .I output\c |
| 580 | \& is a name for the program produced by \c |
| 581 | .B ld\c |
| 582 | \&; if this |
| 583 | option is not specified, the name `\|\c |
| 584 | .B a.out\c |
| 585 | \|' is used by default. The |
| 586 | script command \c |
| 587 | .B OUTPUT\c |
| 588 | \& can also specify the output file name. |
| 589 | |
| 590 | .TP |
| 591 | .BI "-oformat " "output-format"\c |
| 592 | \& |
| 593 | Specify the binary format for the output object file. |
| 594 | You don't usually need to specify this, as |
| 595 | \c |
| 596 | .B ld\c |
| 597 | \& is configured to produce as a default output format the most |
| 598 | usual format on each machine. \c |
| 599 | .I output-format\c |
| 600 | \& is a text string, the |
| 601 | name of a particular format supported by the BFD libraries. |
| 602 | The script command |
| 603 | .B OUTPUT_FORMAT |
| 604 | can also specify the output format, but this option overrides it. |
| 605 | |
| 606 | .TP |
| 607 | .BI "-R " "filename"\c |
| 608 | \& |
| 609 | .I file\c |
| 610 | \& |
| 611 | Read symbol names and their addresses from \c |
| 612 | .I filename\c |
| 613 | \&, but do not |
| 614 | relocate it or include it in the output. This allows your output file |
| 615 | to refer symbolically to absolute locations of memory defined in other |
| 616 | programs. |
| 617 | |
| 618 | .TP |
| 619 | .B \-relax |
| 620 | An option with machine dependent effects. Currently this option is only |
| 621 | supported on the H8/300. |
| 622 | |
| 623 | On some platforms, use this option to perform global optimizations that |
| 624 | become possible when the linker resolves addressing in your program, such |
| 625 | as relaxing address modes and synthesizing new instructions in the |
| 626 | output object file. |
| 627 | |
| 628 | On platforms where this is not supported, `\|\c |
| 629 | .B \-relax\c |
| 630 | \&\|' is accepted, but has no effect. |
| 631 | |
| 632 | .TP |
| 633 | .B \-r |
| 634 | Generates relocatable output\(em\&i.e., generate an output file that can in |
| 635 | turn serve as input to \c |
| 636 | .B ld\c |
| 637 | \&. This is often called \c |
| 638 | .I partial |
| 639 | linking\c |
| 640 | \&. As a side effect, in environments that support standard Unix |
| 641 | magic numbers, this option also sets the output file's magic number to |
| 642 | \c |
| 643 | .B OMAGIC\c |
| 644 | \&. |
| 645 | If this option is not specified, an absolute file is produced. When |
| 646 | linking C++ programs, this option \c |
| 647 | .I will not\c |
| 648 | \& resolve references to |
| 649 | constructors; \c |
| 650 | .B \-Ur\c |
| 651 | \& is an alternative. |
| 652 | |
| 653 | This option does the same as \c |
| 654 | .B \-i\c |
| 655 | \&. |
| 656 | |
| 657 | .TP |
| 658 | .B \-S |
| 659 | Omits debugger symbol information (but not all symbols) from the output file. |
| 660 | |
| 661 | .TP |
| 662 | .B \-s |
| 663 | Omits all symbol information from the output file. |
| 664 | |
| 665 | .TP |
| 666 | .BI "-Tbss " "org"\c |
| 667 | .TP |
| 668 | .BI "-Tdata " "org"\c |
| 669 | .TP |
| 670 | .BI "-Ttext " "org"\c |
| 671 | Use \c |
| 672 | .I org\c |
| 673 | \& as the starting address for\(em\&respectively\(em\&the |
| 674 | \c |
| 675 | .B bss\c |
| 676 | \&, \c |
| 677 | .B data\c |
| 678 | \&, or the \c |
| 679 | .B text\c |
| 680 | \& segment of the output file. |
| 681 | \c |
| 682 | .I textorg\c |
| 683 | \& must be a hexadecimal integer. |
| 684 | |
| 685 | .TP |
| 686 | .BI "-T " "commandfile"\c |
| 687 | \& |
| 688 | .TP |
| 689 | .BI "-T" "commandfile"\c |
| 690 | Equivalent to \c |
| 691 | .B \-c \c |
| 692 | .I commandfile\c |
| 693 | \&\c |
| 694 | \&; supported for compatibility with |
| 695 | other tools. |
| 696 | |
| 697 | .TP |
| 698 | .B \-t |
| 699 | Prints names of input files as \c |
| 700 | .B ld\c |
| 701 | \& processes them. |
| 702 | |
| 703 | .TP |
| 704 | .BI "-u " "sym" |
| 705 | Forces \c |
| 706 | .I sym\c |
| 707 | \& to be entered in the output file as an undefined symbol. |
| 708 | This may, for example, trigger linking of additional modules from |
| 709 | standard libraries. \c |
| 710 | .B \-u\c |
| 711 | \& may be repeated with different option |
| 712 | arguments to enter additional undefined symbols. |
| 713 | |
| 714 | .TP |
| 715 | .B \-Ur |
| 716 | For anything other than C++ programs, this option is equivalent to |
| 717 | \c |
| 718 | .B \-r\c |
| 719 | \&: it generates relocatable output\(em\&i.e., an output file that can in |
| 720 | turn serve as input to \c |
| 721 | .B ld\c |
| 722 | \&. When linking C++ programs, \c |
| 723 | .B \-Ur\c |
| 724 | \& |
| 725 | \c |
| 726 | .I will\c |
| 727 | \& resolve references to constructors, unlike \c |
| 728 | .B \-r\c |
| 729 | \&. |
| 730 | |
| 731 | .TP |
| 732 | .B \-V |
| 733 | Display the version number for \c |
| 734 | .B ld |
| 735 | and list the supported emulations. |
| 736 | Print which input files can and can not be opened. |
| 737 | |
| 738 | .TP |
| 739 | .B \-v |
| 740 | Display the version number for \c |
| 741 | .B ld\c |
| 742 | \&. |
| 743 | Print which input files can and can not be opened. |
| 744 | |
| 745 | .TP |
| 746 | .B \-X |
| 747 | If \c |
| 748 | .B \-s\c |
| 749 | \& or \c |
| 750 | .B \-S\c |
| 751 | \& is also specified, delete only local symbols |
| 752 | beginning with `\|\c |
| 753 | .B L\c |
| 754 | \|'. |
| 755 | |
| 756 | .TP |
| 757 | .B \-x |
| 758 | If \c |
| 759 | .B \-s\c |
| 760 | \& or \c |
| 761 | .B \-S\c |
| 762 | \& is also specified, delete all local symbols, |
| 763 | not just those beginning with `\|\c |
| 764 | .B L\c |
| 765 | \|'. |
| 766 | |
| 767 | .PP |
| 768 | |
| 769 | .SH ENVIRONMENT |
| 770 | \c |
| 771 | You can change the behavior of |
| 772 | .B ld\c |
| 773 | \& with the environment variable \c |
| 774 | .B GNUTARGET\c |
| 775 | \&. |
| 776 | |
| 777 | \c |
| 778 | .B GNUTARGET\c |
| 779 | \& determines the input-file object format if you don't |
| 780 | use \c |
| 781 | .B \-b\c |
| 782 | \& (or its synonym \c |
| 783 | .B \-format\c |
| 784 | \&). Its value should be one |
| 785 | of the BFD names for an input format. If there is no |
| 786 | \c |
| 787 | .B GNUTARGET\c |
| 788 | \& in the environment, \c |
| 789 | .B ld\c |
| 790 | \& uses the natural format |
| 791 | of the host. If \c |
| 792 | .B GNUTARGET\c |
| 793 | \& is set to \c |
| 794 | .B default\c |
| 795 | \& then BFD attempts to discover the |
| 796 | input format by examining binary input files; this method often |
| 797 | succeeds, but there are potential ambiguities, since there is no method |
| 798 | of ensuring that the magic number used to flag object-file formats is |
| 799 | unique. However, the configuration procedure for BFD on each system |
| 800 | places the conventional format for that system first in the search-list, |
| 801 | so ambiguities are resolved in favor of convention. |
| 802 | |
| 803 | .PP |
| 804 | |
| 805 | .SH "SEE ALSO" |
| 806 | |
| 807 | .BR objdump ( 1 ) |
| 808 | .br |
| 809 | .br |
| 810 | .RB "`\|" ld "\|' and `\|" binutils "\|'" |
| 811 | entries in |
| 812 | .B info\c |
| 813 | .br |
| 814 | .I |
| 815 | ld: the GNU linker\c |
| 816 | , Steve Chamberlain and Roland Pesch; |
| 817 | .I |
| 818 | The GNU Binary Utilities\c |
| 819 | , Roland H. Pesch. |
| 820 | |
| 821 | .SH COPYING |
| 822 | Copyright (c) 1991, 1992 Free Software Foundation, Inc. |
| 823 | .PP |
| 824 | Permission is granted to make and distribute verbatim copies of |
| 825 | this manual provided the copyright notice and this permission notice |
| 826 | are preserved on all copies. |
| 827 | .PP |
| 828 | Permission is granted to copy and distribute modified versions of this |
| 829 | manual under the conditions for verbatim copying, provided that the |
| 830 | entire resulting derived work is distributed under the terms of a |
| 831 | permission notice identical to this one. |
| 832 | .PP |
| 833 | Permission is granted to copy and distribute translations of this |
| 834 | manual into another language, under the above conditions for modified |
| 835 | versions, except that this permission notice may be included in |
| 836 | translations approved by the Free Software Foundation instead of in |
| 837 | the original English. |