ld.1

来自「基于4个mips核的noc设计」· 1 代码 · 共 1,509 行 · 第 1/4 页

1
1,509
字号
.\" Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,.\" 2001 Free Software Foundation, Inc..\" See section COPYING for conditions for redistribution.TH ld 1 "" "Free Software Foundation" "GNU Development Tools".de BP.sp.ti \-.2i\(**...SH NAMEld \- the GNU linker.SH SYNOPSIS.hy 0.na.TP.B ld .RB "[\|" \-o ".I output\c\&\|] \c.I objfile\c\&.\|.\|..br.RB "[\|" \-A\c.I architecture\c\&\|] .RB "[\|" "\-b\ "\c.I input-format\c\&\|] .RB "[\|" \-Bstatic "\|]"  .RB "[\|" \-Bgroup "\|]"  .RB "[\|" \-Bdynamic "\|]"  .RB "[\|" \-Bsymbolic "\|]"  .RB "[\|" "\-c\ "\c.I commandfile\c\&\|] .RB "[\|" \-\-cref "\|]".RB "[\|" \-d | \-dc | \-dp\c\|].br.RB "[\|" "\-defsym\ "\c.I symbol\c\&=\c.I expression\c\&\|].RB "[\|" \-\-demangle "\|]".RB "[\|" \-\-no\-demangle "\|]".RB "[\|" "\-e\ "\c.I entry\c\&\|] .RB "[\|" \-embedded\-relocs "\|]".RB "[\|" \-E "\|]" .RB "[\|" \-export\-dynamic "\|]".RB "[\|" "\-f\ "\c.I name\c\&\|].RB "[\|" "\-\-auxiliary\ "\c.I name\c\&\|].RB "[\|" "\-F\ "\c.I name\c\&\|].RB "[\|" "\-\-filter\ "\c.I name\c\&\|].RB "[\|" "\-format\ "\c.I input-format\c\&\|] .RB "[\|" \-g "\|]" .RB "[\|" \-G.I size\c\&\|].RB "[\|" "\-h\ "\c.I name\c\&\|].RB "[\|" "\-soname\ "\c.I name\c\&\|].RB "[\|" \-\-help "\|]".RB "[\|" \-i "\|]".RB "[\|" \-l\c.I ar\c\&\|] .RB "[\|" \-L\c.I searchdir\c\&\|] .RB "[\|" \-M "\|]" .RB "[\|" \-Map.I mapfile\c\&\|] .RB "[\|" \-m.I emulation\c\&\|] .RB "[\|" \-n | \-N "\|]" .RB "[\|" \-noinhibit-exec "\|]" .RB "[\|" \-no\-keep\-memory "\|]" .RB "[\|" \-no\-warn\-mismatch "\|]" .RB "[\|" \-O\c.I level\c\&\|].RB "[\|" "\--oformat\ "\c.I output-format\c\&\|] .RB "[\|" "\-R\ "\c.I filename\c\&\|].RB "[\|" \-relax "\|]".RB "[\|" \-r | \-Ur "\|]" .RB "[\|" "\-rpath\ "\c.I directory\c\&\|].RB "[\|" "\-rpath\-link\ "\c.I directory\c\&\|].RB "[\|" \-S "\|]" .RB "[\|" \-s "\|]" .RB "[\|" \-shared "\|]" .RB "[\|" \-sort\-common "\|]" .RB "[\|" "\-split\-by\-reloc\ "\c.I count\c\&\|].RB "[\|" \-split\-by\-file "\|]" .RB "[\|" "\-T\ "\c.I commandfile\c\&\|]  .RB "[\|" "\-\-section\-start\ "\c.I sectionname\c\&=\c.I sectionorg\c\&\|].RB "[\|" "\-Ttext\ "\c.I textorg\c\&\|] .RB "[\|" "\-Tdata\ "\c.I dataorg\c\&\|] .RB "[\|" "\-Tbss\ "\c.I bssorg\c\&\|].RB "[\|" \-t "\|]" .RB "[\|" "\-u\ "\c.I sym\c\&].RB "[\|" \-V "\|]".RB "[\|" \-v "\|]".RB "[\|" \-\-verbose "\|]".RB "[\|" \-\-version "\|]".RB "[\|" \-warn\-common "\|]" .RB "[\|" \-warn\-constructors "\|]" .RB "[\|" \-warn\-multiple\-gp "\|]" .RB "[\|" \-warn\-once "\|]" .RB "[\|" \-warn\-section\-align "\|]" .RB "[\|" \-\-whole\-archive "\|]" .RB "[\|" \-\-no\-whole\-archive "\|]" .RB "[\|" "\-\-wrap\ "\c.I symbol\c\&\|].RB "[\|" \-X "\|]" .RB "[\|" \-x "\|]" .ad b.hy 1.SH DESCRIPTION\c.B ld\c\& combines a number of object and archive files, relocatestheir data and ties up symbol references. Often the last step inbuilding a new compiled program to run is a call to \c.B ld\c\&.\c.B ld\c\& accepts Linker Command Language files to provide explicit and total control over the linking process.This man page does not describe the command language; see the `\|\c.B ld\c\|' entry in `\|\c.B info\c\|', or the manual.Ild: the GNU linker\&, for full details on the command language and on other aspects ofthe GNU linker. This version of \c.B ld\c\& uses the general purpose BFD librariesto operate on object files. This allows \c.B ld\c\& to read, combine, andwrite object files in many different formats\(em\&for example, COFF or\c.B a.out\c\&.  Different formats may be linked together to produce anyavailable kind of object file.  You can use `\|\c.B objdump \-i\c\|' to get a list of formats supported on various architectures; see .BR objdump ( 1 ).Aside from its flexibility, the GNU linker is more helpful than otherlinkers in providing diagnostic information.  Many linkers abandonexecution immediately upon encountering an error; whenever possible,\c.B ld\c\& continues executing, allowing you to identify other errors(or, in some cases, to get an output file in spite of the error).The GNU linker \c.B ld\c\& is meant to cover a broad range of situations,and to be as compatible as possible with other linkers.  As a result,you have many choices to control its behavior through the command line,and through environment variables..SH OPTIONSThe plethora of command-line options may seem intimidating, but inactual practice few of them are used in any particular context.For instance, a frequent use of \c.B ld\c\& is to link standard Unixobject files on a standard, supported Unix system.  On such a system, tolink a file \c.B hello.o\c\&:.sp.br$\ ld\ \-o\ output\ /lib/crt0.o\ hello.o\ \-lc.br.spThis tells \c.B ld\c\& to produce a file called \c.B output\c\& as theresult of linking the file \c.B /lib/crt0.o\c\& with \c.B hello.o\c\& andthe library \c.B libc.a\c\& which will come from the standard searchdirectories.The command-line options to \c.B ld\c\& may be specified in any order, andmay be repeated at will.  For the most part, repeating an option with adifferent argument will either have no further effect, or override prioroccurrences (those further to the left on the command line) of anoption.  The exceptions\(em\&which may meaningfully be used more than once\(em\&are\c.B \-A\c\&, \c.B \-b\c\& (or its synonym \c.B \-format\c\&), \c.B \-defsym\c\&, \c.B \-\-section\-start\c\&, \c.B \-L\c\&, \c.B \-l\c\&, \c.B \-R\c\&, and \c.B \-u\c\&.The list of object files to be linked together, shown as \c.I objfile\c\&,may follow, precede, or be mixed in with command-line options; save thatan \c.I objfile\c\& argument may not be placed between an option flag andits argument.Usually the linker is invoked with at least one object file, but otherforms of binary input files can also be specified with \c.B \-l\c\&,\c.B \-R\c\&, and the script command language.  If \c.I no\c\& binary inputfiles at all are specified, the linker does not produce any output, andissues the message `\|\c.B No input files\c\|'.Option arguments must either follow the option letter without interveningwhitespace, or be given as separate arguments immediately following theoption that requires them..TP.BI "-A" "architecture"In the current release of \c.B ld\c\&, this option is useful only for theIntel 960 family of architectures.  In that \c.B ld\c\& configuration, the\c.I architecture\c\& argument is one of the two-letter names identifyingmembers of the 960 family; the option specifies the desired outputtarget, and warns of any incompatible instructions in the input files.It also modifies the linker's search strategy for archive libraries, tosupport the use of libraries specific to each particulararchitecture, by including in the search loop names suffixed with thestring identifying the architecture.For example, if your \c.B ld\c\& command line included `\|\c.B \-ACA\c\|' aswell as `\|\c.B \-ltry\c\|', the linker would look (in its built-in searchpaths, and in any paths you specify with \c.B \-L\c\&) for a library withthe names.sp.brtry.brlibtry.a.brtryca.brlibtryca.a.br.spThe first two possibilities would be considered in any event; the lasttwo are due to the use of `\|\c.B \-ACA\c\|'.Future releases of \c.B ld\c\& may support similar functionality forother architecture families.You can meaningfully use \c.B \-A\c\& more than once on a command line, ifan architecture family allows combination of target architectures; eachuse will add another pair of name variants to search for when \c.B \-lspecifies a library..TP.BI "\-b " "input-format"Specify the binary format for input object files that follow this optionon the command line.  You don't usually need to specify this, as\c.B ld\c\& is configured to expect as a default input format the mostusual format on each machine.  \c.I input-format\c\& is a text string, thename of a particular format supported by the BFD libraries.  \c.B \-format \c.I input-format\c\&\c\& has the same effect, as does the script command.BR TARGET .

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?