Options.html 137 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- This file documents the GNU linker LD
  4. (GNU Binutils)
  5. version 2.28.
  6. Copyright (C) 1991-2017 Free Software Foundation, Inc.
  7. Permission is granted to copy, distribute and/or modify this document
  8. under the terms of the GNU Free Documentation License, Version 1.3
  9. or any later version published by the Free Software Foundation;
  10. with no Invariant Sections, with no Front-Cover Texts, and with no
  11. Back-Cover Texts. A copy of the license is included in the
  12. section entitled "GNU Free Documentation License". -->
  13. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>LD: Options</title>
  16. <meta name="description" content="LD: Options">
  17. <meta name="keywords" content="LD: Options">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="LD-Index.html#LD-Index" rel="index" title="LD Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="Invocation.html#Invocation" rel="up" title="Invocation">
  26. <link href="Environment.html#Environment" rel="next" title="Environment">
  27. <link href="Invocation.html#Invocation" rel="prev" title="Invocation">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style:oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="Options"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="Environment.html#Environment" accesskey="n" rel="next">Environment</a>, Up: <a href="Invocation.html#Invocation" accesskey="u" rel="up">Invocation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LD-Index.html#LD-Index" title="Index" rel="index">Index</a>]</p>
  62. </div>
  63. <hr>
  64. <a name="Command-Line-Options"></a>
  65. <h3 class="section">2.1 Command Line Options</h3>
  66. <a name="index-command-line"></a>
  67. <a name="index-options"></a>
  68. <p>The linker supports a plethora of command-line options, but in actual
  69. practice few of them are used in any particular context.
  70. <a name="index-standard-Unix-system"></a>
  71. For instance, a frequent use of <code>ld</code> is to link standard Unix
  72. object files on a standard, supported Unix system. On such a system, to
  73. link a file <code>hello.o</code>:
  74. </p>
  75. <div class="smallexample">
  76. <pre class="smallexample">ld -o <var>output</var> /lib/crt0.o hello.o -lc
  77. </pre></div>
  78. <p>This tells <code>ld</code> to produce a file called <var>output</var> as the
  79. result of linking the file <code>/lib/crt0.o</code> with <code>hello.o</code> and
  80. the library <code>libc.a</code>, which will come from the standard search
  81. directories. (See the discussion of the &lsquo;<samp>-l</samp>&rsquo; option below.)
  82. </p>
  83. <p>Some of the command-line options to <code>ld</code> may be specified at any
  84. point in the command line. However, options which refer to files, such
  85. as &lsquo;<samp>-l</samp>&rsquo; or &lsquo;<samp>-T</samp>&rsquo;, cause the file to be read at the point at
  86. which the option appears in the command line, relative to the object
  87. files and other file options. Repeating non-file options with a
  88. different argument will either have no further effect, or override prior
  89. occurrences (those further to the left on the command line) of that
  90. option. Options which may be meaningfully specified more than once are
  91. noted in the descriptions below.
  92. </p>
  93. <a name="index-object-files"></a>
  94. <p>Non-option arguments are object files or archives which are to be linked
  95. together. They may follow, precede, or be mixed in with command-line
  96. options, except that an object file argument may not be placed between
  97. an option and its argument.
  98. </p>
  99. <p>Usually the linker is invoked with at least one object file, but you can
  100. specify other forms of binary input files using &lsquo;<samp>-l</samp>&rsquo;, &lsquo;<samp>-R</samp>&rsquo;,
  101. and the script command language. If <em>no</em> binary input files at all
  102. are specified, the linker does not produce any output, and issues the
  103. message &lsquo;<samp>No input files</samp>&rsquo;.
  104. </p>
  105. <p>If the linker cannot recognize the format of an object file, it will
  106. assume that it is a linker script. A script specified in this way
  107. augments the main linker script used for the link (either the default
  108. linker script or the one specified by using &lsquo;<samp>-T</samp>&rsquo;). This feature
  109. permits the linker to link against a file which appears to be an object
  110. or an archive, but actually merely defines some symbol values, or uses
  111. <code>INPUT</code> or <code>GROUP</code> to load other objects. Specifying a
  112. script in this way merely augments the main linker script, with the
  113. extra commands placed after the main script; use the &lsquo;<samp>-T</samp>&rsquo; option
  114. to replace the default linker script entirely, but note the effect of
  115. the <code>INSERT</code> command. See <a href="Scripts.html#Scripts">Scripts</a>.
  116. </p>
  117. <p>For options whose names are a single letter,
  118. option arguments must either follow the option letter without intervening
  119. whitespace, or be given as separate arguments immediately following the
  120. option that requires them.
  121. </p>
  122. <p>For options whose names are multiple letters, either one dash or two can
  123. precede the option name; for example, &lsquo;<samp>-trace-symbol</samp>&rsquo; and
  124. &lsquo;<samp>--trace-symbol</samp>&rsquo; are equivalent. Note&mdash;there is one exception to
  125. this rule. Multiple letter options that start with a lower case &rsquo;o&rsquo; can
  126. only be preceded by two dashes. This is to reduce confusion with the
  127. &lsquo;<samp>-o</samp>&rsquo; option. So for example &lsquo;<samp>-omagic</samp>&rsquo; sets the output file
  128. name to &lsquo;<samp>magic</samp>&rsquo; whereas &lsquo;<samp>--omagic</samp>&rsquo; sets the NMAGIC flag on the
  129. output.
  130. </p>
  131. <p>Arguments to multiple-letter options must either be separated from the
  132. option name by an equals sign, or be given as separate arguments
  133. immediately following the option that requires them. For example,
  134. &lsquo;<samp>--trace-symbol foo</samp>&rsquo; and &lsquo;<samp>--trace-symbol=foo</samp>&rsquo; are equivalent.
  135. Unique abbreviations of the names of multiple-letter options are
  136. accepted.
  137. </p>
  138. <p>Note&mdash;if the linker is being invoked indirectly, via a compiler driver
  139. (e.g. &lsquo;<samp>gcc</samp>&rsquo;) then all the linker command line options should be
  140. prefixed by &lsquo;<samp>-Wl,</samp>&rsquo; (or whatever is appropriate for the particular
  141. compiler driver) like this:
  142. </p>
  143. <div class="smallexample">
  144. <pre class="smallexample"> gcc -Wl,--start-group foo.o bar.o -Wl,--end-group
  145. </pre></div>
  146. <p>This is important, because otherwise the compiler driver program may
  147. silently drop the linker options, resulting in a bad link. Confusion
  148. may also arise when passing options that require values through a
  149. driver, as the use of a space between option and argument acts as
  150. a separator, and causes the driver to pass only the option to the linker
  151. and the argument to the compiler. In this case, it is simplest to use
  152. the joined forms of both single- and multiple-letter options, such as:
  153. </p>
  154. <div class="smallexample">
  155. <pre class="smallexample"> gcc foo.o bar.o -Wl,-eENTRY -Wl,-Map=a.map
  156. </pre></div>
  157. <p>Here is a table of the generic command line switches accepted by the GNU
  158. linker:
  159. </p>
  160. <dl compact="compact">
  161. <dt><code>@<var>file</var></code></dt>
  162. <dd><p>Read command-line options from <var>file</var>. The options read are
  163. inserted in place of the original @<var>file</var> option. If <var>file</var>
  164. does not exist, or cannot be read, then the option will be treated
  165. literally, and not removed.
  166. </p>
  167. <p>Options in <var>file</var> are separated by whitespace. A whitespace
  168. character may be included in an option by surrounding the entire
  169. option in either single or double quotes. Any character (including a
  170. backslash) may be included by prefixing the character to be included
  171. with a backslash. The <var>file</var> may itself contain additional
  172. @<var>file</var> options; any such options will be processed recursively.
  173. </p>
  174. <a name="index-_002da-keyword"></a>
  175. </dd>
  176. <dt><code>-a <var>keyword</var></code></dt>
  177. <dd><p>This option is supported for HP/UX compatibility. The <var>keyword</var>
  178. argument must be one of the strings &lsquo;<samp>archive</samp>&rsquo;, &lsquo;<samp>shared</samp>&rsquo;, or
  179. &lsquo;<samp>default</samp>&rsquo;. &lsquo;<samp>-aarchive</samp>&rsquo; is functionally equivalent to
  180. &lsquo;<samp>-Bstatic</samp>&rsquo;, and the other two keywords are functionally equivalent
  181. to &lsquo;<samp>-Bdynamic</samp>&rsquo;. This option may be used any number of times.
  182. </p>
  183. <a name="index-_002d_002daudit-AUDITLIB"></a>
  184. </dd>
  185. <dt><code>--audit <var>AUDITLIB</var></code></dt>
  186. <dd><p>Adds <var>AUDITLIB</var> to the <code>DT_AUDIT</code> entry of the dynamic section.
  187. <var>AUDITLIB</var> is not checked for existence, nor will it use the DT_SONAME
  188. specified in the library. If specified multiple times <code>DT_AUDIT</code>
  189. will contain a colon separated list of audit interfaces to use. If the linker
  190. finds an object with an audit entry while searching for shared libraries,
  191. it will add a corresponding <code>DT_DEPAUDIT</code> entry in the output file.
  192. This option is only meaningful on ELF platforms supporting the rtld-audit
  193. interface.
  194. </p>
  195. <a name="index-architectures"></a>
  196. <a name="index-_002dA-arch"></a>
  197. </dd>
  198. <dt><code>-A <var>architecture</var></code></dt>
  199. <dd><a name="index-_002d_002darchitecture_003darch"></a>
  200. </dd>
  201. <dt><code>--architecture=<var>architecture</var></code></dt>
  202. <dd><p>In the current release of <code>ld</code>, this option is useful only for the
  203. Intel 960 family of architectures. In that <code>ld</code> configuration, the
  204. <var>architecture</var> argument identifies the particular architecture in
  205. the 960 family, enabling some safeguards and modifying the
  206. archive-library search path. See <a href="i960.html#i960"><code>ld</code> and the Intel 960
  207. family</a>, for details.
  208. </p>
  209. <p>Future releases of <code>ld</code> may support similar functionality for
  210. other architecture families.
  211. </p>
  212. <a name="index-binary-input-format"></a>
  213. <a name="index-_002db-format"></a>
  214. <a name="index-_002d_002dformat_003dformat"></a>
  215. <a name="index-input-format"></a>
  216. <a name="index-input-format-1"></a>
  217. </dd>
  218. <dt><code>-b <var>input-format</var></code></dt>
  219. <dt><code>--format=<var>input-format</var></code></dt>
  220. <dd><p><code>ld</code> may be configured to support more than one kind of object
  221. file. If your <code>ld</code> is configured this way, you can use the
  222. &lsquo;<samp>-b</samp>&rsquo; option to specify the binary format for input object files
  223. that follow this option on the command line. Even when <code>ld</code> is
  224. configured to support alternative object formats, you don&rsquo;t usually need
  225. to specify this, as <code>ld</code> should be configured to expect as a
  226. default input format the most usual format on each machine.
  227. <var>input-format</var> is a text string, the name of a particular format
  228. supported by the BFD libraries. (You can list the available binary
  229. formats with &lsquo;<samp>objdump -i</samp>&rsquo;.)
  230. See <a href="BFD.html#BFD">BFD</a>.
  231. </p>
  232. <p>You may want to use this option if you are linking files with an unusual
  233. binary format. You can also use &lsquo;<samp>-b</samp>&rsquo; to switch formats explicitly (when
  234. linking object files of different formats), by including
  235. &lsquo;<samp>-b <var>input-format</var></samp>&rsquo; before each group of object files in a
  236. particular format.
  237. </p>
  238. <p>The default format is taken from the environment variable
  239. <code>GNUTARGET</code>.
  240. See <a href="Environment.html#Environment">Environment</a>.
  241. You can also define the input format from a script, using the command
  242. <code>TARGET</code>;
  243. see <a href="Format-Commands.html#Format-Commands">Format Commands</a>.
  244. </p>
  245. <a name="index-_002dc-MRI_002dcmdfile"></a>
  246. <a name="index-_002d_002dmri_002dscript_003dMRI_002dcmdfile"></a>
  247. <a name="index-compatibility_002c-MRI"></a>
  248. </dd>
  249. <dt><code>-c <var>MRI-commandfile</var></code></dt>
  250. <dt><code>--mri-script=<var>MRI-commandfile</var></code></dt>
  251. <dd><p>For compatibility with linkers produced by MRI, <code>ld</code> accepts script
  252. files written in an alternate, restricted command language, described in
  253. <a href="MRI.html#MRI">MRI Compatible Script Files</a>.
  254. Introduce MRI script files with
  255. the option &lsquo;<samp>-c</samp>&rsquo;; use the &lsquo;<samp>-T</samp>&rsquo; option to run linker
  256. scripts written in the general-purpose <code>ld</code> scripting language.
  257. If <var>MRI-cmdfile</var> does not exist, <code>ld</code> looks for it in the directories
  258. specified by any &lsquo;<samp>-L</samp>&rsquo; options.
  259. </p>
  260. <a name="index-common-allocation"></a>
  261. <a name="index-_002dd"></a>
  262. <a name="index-_002ddc"></a>
  263. <a name="index-_002ddp"></a>
  264. </dd>
  265. <dt><code>-d</code></dt>
  266. <dt><code>-dc</code></dt>
  267. <dt><code>-dp</code></dt>
  268. <dd><p>These three options are equivalent; multiple forms are supported for
  269. compatibility with other linkers. They assign space to common symbols
  270. even if a relocatable output file is specified (with &lsquo;<samp>-r</samp>&rsquo;). The
  271. script command <code>FORCE_COMMON_ALLOCATION</code> has the same effect.
  272. See <a href="Miscellaneous-Commands.html#Miscellaneous-Commands">Miscellaneous Commands</a>.
  273. </p>
  274. <a name="index-_002d_002ddepaudit-AUDITLIB"></a>
  275. <a name="index-_002dP-AUDITLIB"></a>
  276. </dd>
  277. <dt><code>--depaudit <var>AUDITLIB</var></code></dt>
  278. <dt><code>-P <var>AUDITLIB</var></code></dt>
  279. <dd><p>Adds <var>AUDITLIB</var> to the <code>DT_DEPAUDIT</code> entry of the dynamic section.
  280. <var>AUDITLIB</var> is not checked for existence, nor will it use the DT_SONAME
  281. specified in the library. If specified multiple times <code>DT_DEPAUDIT</code>
  282. will contain a colon separated list of audit interfaces to use. This
  283. option is only meaningful on ELF platforms supporting the rtld-audit interface.
  284. The -P option is provided for Solaris compatibility.
  285. </p>
  286. <a name="index-entry-point_002c-from-command-line"></a>
  287. <a name="index-_002de-entry"></a>
  288. <a name="index-_002d_002dentry_003dentry"></a>
  289. </dd>
  290. <dt><code>-e <var>entry</var></code></dt>
  291. <dt><code>--entry=<var>entry</var></code></dt>
  292. <dd><p>Use <var>entry</var> as the explicit symbol for beginning execution of your
  293. program, rather than the default entry point. If there is no symbol
  294. named <var>entry</var>, the linker will try to parse <var>entry</var> as a number,
  295. and use that as the entry address (the number will be interpreted in
  296. base 10; you may use a leading &lsquo;<samp>0x</samp>&rsquo; for base 16, or a leading
  297. &lsquo;<samp>0</samp>&rsquo; for base 8). See <a href="Entry-Point.html#Entry-Point">Entry Point</a>, for a discussion of defaults
  298. and other ways of specifying the entry point.
  299. </p>
  300. <a name="index-_002d_002dexclude_002dlibs"></a>
  301. </dd>
  302. <dt><code>--exclude-libs <var>lib</var>,<var>lib</var>,...</code></dt>
  303. <dd><p>Specifies a list of archive libraries from which symbols should not be automatically
  304. exported. The library names may be delimited by commas or colons. Specifying
  305. <code>--exclude-libs ALL</code> excludes symbols in all archive libraries from
  306. automatic export. This option is available only for the i386 PE targeted
  307. port of the linker and for ELF targeted ports. For i386 PE, symbols
  308. explicitly listed in a .def file are still exported, regardless of this
  309. option. For ELF targeted ports, symbols affected by this option will
  310. be treated as hidden.
  311. </p>
  312. <a name="index-_002d_002dexclude_002dmodules_002dfor_002dimplib"></a>
  313. </dd>
  314. <dt><code>--exclude-modules-for-implib <var>module</var>,<var>module</var>,...</code></dt>
  315. <dd><p>Specifies a list of object files or archive members, from which symbols
  316. should not be automatically exported, but which should be copied wholesale
  317. into the import library being generated during the link. The module names
  318. may be delimited by commas or colons, and must match exactly the filenames
  319. used by <code>ld</code> to open the files; for archive members, this is simply
  320. the member name, but for object files the name listed must include and
  321. match precisely any path used to specify the input file on the linker&rsquo;s
  322. command-line. This option is available only for the i386 PE targeted port
  323. of the linker. Symbols explicitly listed in a .def file are still exported,
  324. regardless of this option.
  325. </p>
  326. <a name="index-dynamic-symbol-table"></a>
  327. <a name="index-_002dE"></a>
  328. <a name="index-_002d_002dexport_002ddynamic"></a>
  329. <a name="index-_002d_002dno_002dexport_002ddynamic"></a>
  330. </dd>
  331. <dt><code>-E</code></dt>
  332. <dt><code>--export-dynamic</code></dt>
  333. <dt><code>--no-export-dynamic</code></dt>
  334. <dd><p>When creating a dynamically linked executable, using the <samp>-E</samp>
  335. option or the <samp>--export-dynamic</samp> option causes the linker to add
  336. all symbols to the dynamic symbol table. The dynamic symbol table is the
  337. set of symbols which are visible from dynamic objects at run time.
  338. </p>
  339. <p>If you do not use either of these options (or use the
  340. <samp>--no-export-dynamic</samp> option to restore the default behavior), the
  341. dynamic symbol table will normally contain only those symbols which are
  342. referenced by some dynamic object mentioned in the link.
  343. </p>
  344. <p>If you use <code>dlopen</code> to load a dynamic object which needs to refer
  345. back to the symbols defined by the program, rather than some other
  346. dynamic object, then you will probably need to use this option when
  347. linking the program itself.
  348. </p>
  349. <p>You can also use the dynamic list to control what symbols should
  350. be added to the dynamic symbol table if the output format supports it.
  351. See the description of &lsquo;<samp>--dynamic-list</samp>&rsquo;.
  352. </p>
  353. <p>Note that this option is specific to ELF targeted ports. PE targets
  354. support a similar function to export all symbols from a DLL or EXE; see
  355. the description of &lsquo;<samp>--export-all-symbols</samp>&rsquo; below.
  356. </p>
  357. <a name="index-big_002dendian-objects"></a>
  358. <a name="index-endianness"></a>
  359. <a name="index-_002dEB"></a>
  360. </dd>
  361. <dt><code>-EB</code></dt>
  362. <dd><p>Link big-endian objects. This affects the default output format.
  363. </p>
  364. <a name="index-little_002dendian-objects"></a>
  365. <a name="index-_002dEL"></a>
  366. </dd>
  367. <dt><code>-EL</code></dt>
  368. <dd><p>Link little-endian objects. This affects the default output format.
  369. </p>
  370. <a name="index-_002df-name"></a>
  371. <a name="index-_002d_002dauxiliary_003dname"></a>
  372. </dd>
  373. <dt><code>-f <var>name</var></code></dt>
  374. <dt><code>--auxiliary=<var>name</var></code></dt>
  375. <dd><p>When creating an ELF shared object, set the internal DT_AUXILIARY field
  376. to the specified name. This tells the dynamic linker that the symbol
  377. table of the shared object should be used as an auxiliary filter on the
  378. symbol table of the shared object <var>name</var>.
  379. </p>
  380. <p>If you later link a program against this filter object, then, when you
  381. run the program, the dynamic linker will see the DT_AUXILIARY field. If
  382. the dynamic linker resolves any symbols from the filter object, it will
  383. first check whether there is a definition in the shared object
  384. <var>name</var>. If there is one, it will be used instead of the definition
  385. in the filter object. The shared object <var>name</var> need not exist.
  386. Thus the shared object <var>name</var> may be used to provide an alternative
  387. implementation of certain functions, perhaps for debugging or for
  388. machine specific performance.
  389. </p>
  390. <p>This option may be specified more than once. The DT_AUXILIARY entries
  391. will be created in the order in which they appear on the command line.
  392. </p>
  393. <a name="index-_002dF-name"></a>
  394. <a name="index-_002d_002dfilter_003dname"></a>
  395. </dd>
  396. <dt><code>-F <var>name</var></code></dt>
  397. <dt><code>--filter=<var>name</var></code></dt>
  398. <dd><p>When creating an ELF shared object, set the internal DT_FILTER field to
  399. the specified name. This tells the dynamic linker that the symbol table
  400. of the shared object which is being created should be used as a filter
  401. on the symbol table of the shared object <var>name</var>.
  402. </p>
  403. <p>If you later link a program against this filter object, then, when you
  404. run the program, the dynamic linker will see the DT_FILTER field. The
  405. dynamic linker will resolve symbols according to the symbol table of the
  406. filter object as usual, but it will actually link to the definitions
  407. found in the shared object <var>name</var>. Thus the filter object can be
  408. used to select a subset of the symbols provided by the object
  409. <var>name</var>.
  410. </p>
  411. <p>Some older linkers used the <samp>-F</samp> option throughout a compilation
  412. toolchain for specifying object-file format for both input and output
  413. object files.
  414. The <small>GNU</small> linker uses other mechanisms for this purpose: the
  415. <samp>-b</samp>, <samp>--format</samp>, <samp>--oformat</samp> options, the
  416. <code>TARGET</code> command in linker scripts, and the <code>GNUTARGET</code>
  417. environment variable.
  418. The <small>GNU</small> linker will ignore the <samp>-F</samp> option when not
  419. creating an ELF shared object.
  420. </p>
  421. <a name="index-finalization-function"></a>
  422. <a name="index-_002dfini_003dname"></a>
  423. </dd>
  424. <dt><code>-fini=<var>name</var></code></dt>
  425. <dd><p>When creating an ELF executable or shared object, call NAME when the
  426. executable or shared object is unloaded, by setting DT_FINI to the
  427. address of the function. By default, the linker uses <code>_fini</code> as
  428. the function to call.
  429. </p>
  430. <a name="index-_002dg"></a>
  431. </dd>
  432. <dt><code>-g</code></dt>
  433. <dd><p>Ignored. Provided for compatibility with other tools.
  434. </p>
  435. <a name="index-_002dG-value"></a>
  436. <a name="index-_002d_002dgpsize_003dvalue"></a>
  437. <a name="index-object-size"></a>
  438. </dd>
  439. <dt><code>-G <var>value</var></code></dt>
  440. <dt><code>--gpsize=<var>value</var></code></dt>
  441. <dd><p>Set the maximum size of objects to be optimized using the GP register to
  442. <var>size</var>. This is only meaningful for object file formats such as
  443. MIPS ELF that support putting large and small objects into different
  444. sections. This is ignored for other object file formats.
  445. </p>
  446. <a name="index-runtime-library-name"></a>
  447. <a name="index-_002dh-name"></a>
  448. <a name="index-_002dsoname_003dname"></a>
  449. </dd>
  450. <dt><code>-h <var>name</var></code></dt>
  451. <dt><code>-soname=<var>name</var></code></dt>
  452. <dd><p>When creating an ELF shared object, set the internal DT_SONAME field to
  453. the specified name. When an executable is linked with a shared object
  454. which has a DT_SONAME field, then when the executable is run the dynamic
  455. linker will attempt to load the shared object specified by the DT_SONAME
  456. field rather than the using the file name given to the linker.
  457. </p>
  458. <a name="index-_002di"></a>
  459. <a name="index-incremental-link"></a>
  460. </dd>
  461. <dt><code>-i</code></dt>
  462. <dd><p>Perform an incremental link (same as option &lsquo;<samp>-r</samp>&rsquo;).
  463. </p>
  464. <a name="index-initialization-function"></a>
  465. <a name="index-_002dinit_003dname"></a>
  466. </dd>
  467. <dt><code>-init=<var>name</var></code></dt>
  468. <dd><p>When creating an ELF executable or shared object, call NAME when the
  469. executable or shared object is loaded, by setting DT_INIT to the address
  470. of the function. By default, the linker uses <code>_init</code> as the
  471. function to call.
  472. </p>
  473. <a name="index-archive-files_002c-from-cmd-line"></a>
  474. <a name="index-_002dl-namespec"></a>
  475. <a name="index-_002d_002dlibrary_003dnamespec"></a>
  476. </dd>
  477. <dt><code>-l <var>namespec</var></code></dt>
  478. <dt><code>--library=<var>namespec</var></code></dt>
  479. <dd><p>Add the archive or object file specified by <var>namespec</var> to the
  480. list of files to link. This option may be used any number of times.
  481. If <var>namespec</var> is of the form <samp>:<var>filename</var></samp>, <code>ld</code>
  482. will search the library path for a file called <var>filename</var>, otherwise it
  483. will search the library path for a file called <samp>lib<var>namespec</var>.a</samp>.
  484. </p>
  485. <p>On systems which support shared libraries, <code>ld</code> may also search for
  486. files other than <samp>lib<var>namespec</var>.a</samp>. Specifically, on ELF
  487. and SunOS systems, <code>ld</code> will search a directory for a library
  488. called <samp>lib<var>namespec</var>.so</samp> before searching for one called
  489. <samp>lib<var>namespec</var>.a</samp>. (By convention, a <code>.so</code> extension
  490. indicates a shared library.) Note that this behavior does not apply
  491. to <samp>:<var>filename</var></samp>, which always specifies a file called
  492. <var>filename</var>.
  493. </p>
  494. <p>The linker will search an archive only once, at the location where it is
  495. specified on the command line. If the archive defines a symbol which
  496. was undefined in some object which appeared before the archive on the
  497. command line, the linker will include the appropriate file(s) from the
  498. archive. However, an undefined symbol in an object appearing later on
  499. the command line will not cause the linker to search the archive again.
  500. </p>
  501. <p>See the <samp>-(</samp> option for a way to force the linker to search
  502. archives multiple times.
  503. </p>
  504. <p>You may list the same archive multiple times on the command line.
  505. </p>
  506. <p>This type of archive searching is standard for Unix linkers. However,
  507. if you are using <code>ld</code> on AIX, note that it is different from the
  508. behaviour of the AIX linker.
  509. </p>
  510. <a name="index-search-directory_002c-from-cmd-line"></a>
  511. <a name="index-_002dL-dir"></a>
  512. <a name="index-_002d_002dlibrary_002dpath_003ddir"></a>
  513. </dd>
  514. <dt><code>-L <var>searchdir</var></code></dt>
  515. <dt><code>--library-path=<var>searchdir</var></code></dt>
  516. <dd><p>Add path <var>searchdir</var> to the list of paths that <code>ld</code> will search
  517. for archive libraries and <code>ld</code> control scripts. You may use this
  518. option any number of times. The directories are searched in the order
  519. in which they are specified on the command line. Directories specified
  520. on the command line are searched before the default directories. All
  521. <samp>-L</samp> options apply to all <samp>-l</samp> options, regardless of the
  522. order in which the options appear. <samp>-L</samp> options do not affect
  523. how <code>ld</code> searches for a linker script unless <samp>-T</samp>
  524. option is specified.
  525. </p>
  526. <p>If <var>searchdir</var> begins with <code>=</code>, then the <code>=</code> will be replaced
  527. by the <em>sysroot prefix</em>, controlled by the &lsquo;<samp>--sysroot</samp>&rsquo; option, or
  528. specified when the linker is configured.
  529. </p>
  530. <p>The default set of paths searched (without being specified with
  531. &lsquo;<samp>-L</samp>&rsquo;) depends on which emulation mode <code>ld</code> is using, and in
  532. some cases also on how it was configured. See <a href="Environment.html#Environment">Environment</a>.
  533. </p>
  534. <p>The paths can also be specified in a link script with the
  535. <code>SEARCH_DIR</code> command. Directories specified this way are searched
  536. at the point in which the linker script appears in the command line.
  537. </p>
  538. <a name="index-emulation"></a>
  539. <a name="index-_002dm-emulation"></a>
  540. </dd>
  541. <dt><code>-m <var>emulation</var></code></dt>
  542. <dd><p>Emulate the <var>emulation</var> linker. You can list the available
  543. emulations with the &lsquo;<samp>--verbose</samp>&rsquo; or &lsquo;<samp>-V</samp>&rsquo; options.
  544. </p>
  545. <p>If the &lsquo;<samp>-m</samp>&rsquo; option is not used, the emulation is taken from the
  546. <code>LDEMULATION</code> environment variable, if that is defined.
  547. </p>
  548. <p>Otherwise, the default emulation depends upon how the linker was
  549. configured.
  550. </p>
  551. <a name="index-link-map"></a>
  552. <a name="index-_002dM"></a>
  553. <a name="index-_002d_002dprint_002dmap"></a>
  554. </dd>
  555. <dt><code>-M</code></dt>
  556. <dt><code>--print-map</code></dt>
  557. <dd><p>Print a link map to the standard output. A link map provides
  558. information about the link, including the following:
  559. </p>
  560. <ul>
  561. <li> Where object files are mapped into memory.
  562. </li><li> How common symbols are allocated.
  563. </li><li> All archive members included in the link, with a mention of the symbol
  564. which caused the archive member to be brought in.
  565. </li><li> The values assigned to symbols.
  566. <p>Note - symbols whose values are computed by an expression which
  567. involves a reference to a previous value of the same symbol may not
  568. have correct result displayed in the link map. This is because the
  569. linker discards intermediate results and only retains the final value
  570. of an expression. Under such circumstances the linker will display
  571. the final value enclosed by square brackets. Thus for example a
  572. linker script containing:
  573. </p>
  574. <div class="smallexample">
  575. <pre class="smallexample"> foo = 1
  576. foo = foo * 4
  577. foo = foo + 8
  578. </pre></div>
  579. <p>will produce the following output in the link map if the <samp>-M</samp>
  580. option is used:
  581. </p>
  582. <div class="smallexample">
  583. <pre class="smallexample"> 0x00000001 foo = 0x1
  584. [0x0000000c] foo = (foo * 0x4)
  585. [0x0000000c] foo = (foo + 0x8)
  586. </pre></div>
  587. <p>See <a href="Expressions.html#Expressions">Expressions</a> for more information about expressions in linker
  588. scripts.
  589. </p></li></ul>
  590. <a name="index-_002dn"></a>
  591. <a name="index-read_002donly-text"></a>
  592. <a name="index-NMAGIC"></a>
  593. <a name="index-_002d_002dnmagic"></a>
  594. </dd>
  595. <dt><code>-n</code></dt>
  596. <dt><code>--nmagic</code></dt>
  597. <dd><p>Turn off page alignment of sections, and disable linking against shared
  598. libraries. If the output format supports Unix style magic numbers,
  599. mark the output as <code>NMAGIC</code>.
  600. </p>
  601. <a name="index-_002dN"></a>
  602. <a name="index-_002d_002domagic"></a>
  603. <a name="index-read_002fwrite-from-cmd-line"></a>
  604. <a name="index-OMAGIC"></a>
  605. </dd>
  606. <dt><code>-N</code></dt>
  607. <dt><code>--omagic</code></dt>
  608. <dd><p>Set the text and data sections to be readable and writable. Also, do
  609. not page-align the data segment, and disable linking against shared
  610. libraries. If the output format supports Unix style magic numbers,
  611. mark the output as <code>OMAGIC</code>. Note: Although a writable text section
  612. is allowed for PE-COFF targets, it does not conform to the format
  613. specification published by Microsoft.
  614. </p>
  615. <a name="index-_002d_002dno_002domagic"></a>
  616. <a name="index-OMAGIC-1"></a>
  617. </dd>
  618. <dt><code>--no-omagic</code></dt>
  619. <dd><p>This option negates most of the effects of the <samp>-N</samp> option. It
  620. sets the text section to be read-only, and forces the data segment to
  621. be page-aligned. Note - this option does not enable linking against
  622. shared libraries. Use <samp>-Bdynamic</samp> for this.
  623. </p>
  624. <a name="index-_002do-output"></a>
  625. <a name="index-_002d_002doutput_003doutput"></a>
  626. <a name="index-naming-the-output-file"></a>
  627. </dd>
  628. <dt><code>-o <var>output</var></code></dt>
  629. <dt><code>--output=<var>output</var></code></dt>
  630. <dd><p>Use <var>output</var> as the name for the program produced by <code>ld</code>; if this
  631. option is not specified, the name <samp>a.out</samp> is used by default. The
  632. script command <code>OUTPUT</code> can also specify the output file name.
  633. </p>
  634. <a name="index-_002dO-level"></a>
  635. <a name="index-generating-optimized-output"></a>
  636. </dd>
  637. <dt><code>-O <var>level</var></code></dt>
  638. <dd><p>If <var>level</var> is a numeric values greater than zero <code>ld</code> optimizes
  639. the output. This might take significantly longer and therefore probably
  640. should only be enabled for the final binary. At the moment this
  641. option only affects ELF shared library generation. Future releases of
  642. the linker may make more use of this option. Also currently there is
  643. no difference in the linker&rsquo;s behaviour for different non-zero values
  644. of this option. Again this may change with future releases.
  645. </p>
  646. <a name="index-_002d_002dpush_002dstate"></a>
  647. <a name="index-push-state-governing-input-file-handling"></a>
  648. </dd>
  649. <dt><code>--push-state</code></dt>
  650. <dd><p>The <samp>--push-state</samp> allows to preserve the current state of the
  651. flags which govern the input file handling so that they can all be
  652. restored with one corresponding <samp>--pop-state</samp> option.
  653. </p>
  654. <p>The option which are covered are: <samp>-Bdynamic</samp>, <samp>-Bstatic</samp>,
  655. <samp>-dn</samp>, <samp>-dy</samp>, <samp>-call_shared</samp>, <samp>-non_shared</samp>,
  656. <samp>-static</samp>, <samp>-N</samp>, <samp>-n</samp>, <samp>--whole-archive</samp>,
  657. <samp>--no-whole-archive</samp>, <samp>-r</samp>, <samp>-Ur</samp>,
  658. <samp>--copy-dt-needed-entries</samp>, <samp>--no-copy-dt-needed-entries</samp>,
  659. <samp>--as-needed</samp>, <samp>--no-as-needed</samp>, and <samp>-a</samp>.
  660. </p>
  661. <p>One target for this option are specifications for <samp>pkg-config</samp>. When
  662. used with the <samp>--libs</samp> option all possibly needed libraries are
  663. listed and then possibly linked with all the time. It is better to return
  664. something as follows:
  665. </p>
  666. <div class="smallexample">
  667. <pre class="smallexample">-Wl,--push-state,--as-needed -libone -libtwo -Wl,--pop-state
  668. </pre></div>
  669. <a name="index-_002d_002dpop_002dstate"></a>
  670. <a name="index-pop-state-governing-input-file-handling"></a>
  671. <p>Undoes the effect of &ndash;push-state, restores the previous values of the
  672. flags governing input file handling.
  673. </p>
  674. <a name="index-_002dq"></a>
  675. <a name="index-_002d_002demit_002drelocs"></a>
  676. <a name="index-retain-relocations-in-final-executable"></a>
  677. </dd>
  678. <dt><code>-q</code></dt>
  679. <dt><code>--emit-relocs</code></dt>
  680. <dd><p>Leave relocation sections and contents in fully linked executables.
  681. Post link analysis and optimization tools may need this information in
  682. order to perform correct modifications of executables. This results
  683. in larger executables.
  684. </p>
  685. <p>This option is currently only supported on ELF platforms.
  686. </p>
  687. <a name="index-_002d_002dforce_002ddynamic"></a>
  688. <a name="index-forcing-the-creation-of-dynamic-sections"></a>
  689. </dd>
  690. <dt><code>--force-dynamic</code></dt>
  691. <dd><p>Force the output file to have dynamic sections. This option is specific
  692. to VxWorks targets.
  693. </p>
  694. <a name="index-partial-link"></a>
  695. <a name="index-relocatable-output"></a>
  696. <a name="index-_002dr"></a>
  697. <a name="index-_002d_002drelocatable"></a>
  698. </dd>
  699. <dt><code>-r</code></dt>
  700. <dt><code>--relocatable</code></dt>
  701. <dd><p>Generate relocatable output&mdash;i.e., generate an output file that can in
  702. turn serve as input to <code>ld</code>. This is often called <em>partial
  703. linking</em>. As a side effect, in environments that support standard Unix
  704. magic numbers, this option also sets the output file&rsquo;s magic number to
  705. <code>OMAGIC</code>.
  706. If this option is not specified, an absolute file is produced. When
  707. linking C++ programs, this option <em>will not</em> resolve references to
  708. constructors; to do that, use &lsquo;<samp>-Ur</samp>&rsquo;.
  709. </p>
  710. <p>When an input file does not have the same format as the output file,
  711. partial linking is only supported if that input file does not contain any
  712. relocations. Different output formats can have further restrictions; for
  713. example some <code>a.out</code>-based formats do not support partial linking
  714. with input files in other formats at all.
  715. </p>
  716. <p>This option does the same thing as &lsquo;<samp>-i</samp>&rsquo;.
  717. </p>
  718. <a name="index-_002dR-file"></a>
  719. <a name="index-_002d_002djust_002dsymbols_003dfile"></a>
  720. <a name="index-symbol_002donly-input"></a>
  721. </dd>
  722. <dt><code>-R <var>filename</var></code></dt>
  723. <dt><code>--just-symbols=<var>filename</var></code></dt>
  724. <dd><p>Read symbol names and their addresses from <var>filename</var>, but do not
  725. relocate it or include it in the output. This allows your output file
  726. to refer symbolically to absolute locations of memory defined in other
  727. programs. You may use this option more than once.
  728. </p>
  729. <p>For compatibility with other ELF linkers, if the <samp>-R</samp> option is
  730. followed by a directory name, rather than a file name, it is treated as
  731. the <samp>-rpath</samp> option.
  732. </p>
  733. <a name="index-_002ds"></a>
  734. <a name="index-_002d_002dstrip_002dall"></a>
  735. <a name="index-strip-all-symbols"></a>
  736. </dd>
  737. <dt><code>-s</code></dt>
  738. <dt><code>--strip-all</code></dt>
  739. <dd><p>Omit all symbol information from the output file.
  740. </p>
  741. <a name="index-_002dS"></a>
  742. <a name="index-_002d_002dstrip_002ddebug"></a>
  743. <a name="index-strip-debugger-symbols"></a>
  744. </dd>
  745. <dt><code>-S</code></dt>
  746. <dt><code>--strip-debug</code></dt>
  747. <dd><p>Omit debugger symbol information (but not all symbols) from the output file.
  748. </p>
  749. <a name="index-_002dt"></a>
  750. <a name="index-_002d_002dtrace"></a>
  751. <a name="index-input-files_002c-displaying"></a>
  752. </dd>
  753. <dt><code>-t</code></dt>
  754. <dt><code>--trace</code></dt>
  755. <dd><p>Print the names of the input files as <code>ld</code> processes them.
  756. </p>
  757. <a name="index-_002dT-script"></a>
  758. <a name="index-_002d_002dscript_003dscript"></a>
  759. <a name="index-script-files"></a>
  760. </dd>
  761. <dt><code>-T <var>scriptfile</var></code></dt>
  762. <dt><code>--script=<var>scriptfile</var></code></dt>
  763. <dd><p>Use <var>scriptfile</var> as the linker script. This script replaces
  764. <code>ld</code>&rsquo;s default linker script (rather than adding to it), so
  765. <var>commandfile</var> must specify everything necessary to describe the
  766. output file. See <a href="Scripts.html#Scripts">Scripts</a>. If <var>scriptfile</var> does not exist in
  767. the current directory, <code>ld</code> looks for it in the directories
  768. specified by any preceding &lsquo;<samp>-L</samp>&rsquo; options. Multiple &lsquo;<samp>-T</samp>&rsquo;
  769. options accumulate.
  770. </p>
  771. <a name="index-_002ddT-script"></a>
  772. <a name="index-_002d_002ddefault_002dscript_003dscript"></a>
  773. <a name="index-script-files-1"></a>
  774. </dd>
  775. <dt><code>-dT <var>scriptfile</var></code></dt>
  776. <dt><code>--default-script=<var>scriptfile</var></code></dt>
  777. <dd><p>Use <var>scriptfile</var> as the default linker script. See <a href="Scripts.html#Scripts">Scripts</a>.
  778. </p>
  779. <p>This option is similar to the <samp>--script</samp> option except that
  780. processing of the script is delayed until after the rest of the
  781. command line has been processed. This allows options placed after the
  782. <samp>--default-script</samp> option on the command line to affect the
  783. behaviour of the linker script, which can be important when the linker
  784. command line cannot be directly controlled by the user. (eg because
  785. the command line is being constructed by another tool, such as
  786. &lsquo;<samp>gcc</samp>&rsquo;).
  787. </p>
  788. <a name="index-_002du-symbol"></a>
  789. <a name="index-_002d_002dundefined_003dsymbol"></a>
  790. <a name="index-undefined-symbol"></a>
  791. </dd>
  792. <dt><code>-u <var>symbol</var></code></dt>
  793. <dt><code>--undefined=<var>symbol</var></code></dt>
  794. <dd><p>Force <var>symbol</var> to be entered in the output file as an undefined
  795. symbol. Doing this may, for example, trigger linking of additional
  796. modules from standard libraries. &lsquo;<samp>-u</samp>&rsquo; may be repeated with
  797. different option arguments to enter additional undefined symbols. This
  798. option is equivalent to the <code>EXTERN</code> linker script command.
  799. </p>
  800. <p>If this option is being used to force additional modules to be pulled
  801. into the link, and if it is an error for the symbol to remain
  802. undefined, then the option <samp>--require-defined</samp> should be used
  803. instead.
  804. </p>
  805. <a name="index-_002d_002drequire_002ddefined_003dsymbol"></a>
  806. <a name="index-symbols_002c-require-defined"></a>
  807. <a name="index-defined-symbol"></a>
  808. </dd>
  809. <dt><code>--require-defined=<var>symbol</var></code></dt>
  810. <dd><p>Require that <var>symbol</var> is defined in the output file. This option
  811. is the same as option <samp>--undefined</samp> except that if <var>symbol</var>
  812. is not defined in the output file then the linker will issue an error
  813. and exit. The same effect can be achieved in a linker script by using
  814. <code>EXTERN</code>, <code>ASSERT</code> and <code>DEFINED</code> together. This option
  815. can be used multiple times to require additional symbols.
  816. </p>
  817. <a name="index-_002dUr"></a>
  818. <a name="index-constructors"></a>
  819. </dd>
  820. <dt><code>-Ur</code></dt>
  821. <dd><p>For anything other than C++ programs, this option is equivalent to
  822. &lsquo;<samp>-r</samp>&rsquo;: it generates relocatable output&mdash;i.e., an output file that can in
  823. turn serve as input to <code>ld</code>. When linking C++ programs, &lsquo;<samp>-Ur</samp>&rsquo;
  824. <em>does</em> resolve references to constructors, unlike &lsquo;<samp>-r</samp>&rsquo;.
  825. It does not work to use &lsquo;<samp>-Ur</samp>&rsquo; on files that were themselves linked
  826. with &lsquo;<samp>-Ur</samp>&rsquo;; once the constructor table has been built, it cannot
  827. be added to. Use &lsquo;<samp>-Ur</samp>&rsquo; only for the last partial link, and
  828. &lsquo;<samp>-r</samp>&rsquo; for the others.
  829. </p>
  830. <a name="index-_002d_002dorphan_002dhandling_003dMODE"></a>
  831. <a name="index-orphan-sections"></a>
  832. <a name="index-sections_002c-orphan"></a>
  833. </dd>
  834. <dt><code>--orphan-handling=<var>MODE</var></code></dt>
  835. <dd><p>Control how orphan sections are handled. An orphan section is one not
  836. specifically mentioned in a linker script. See <a href="Orphan-Sections.html#Orphan-Sections">Orphan Sections</a>.
  837. </p>
  838. <p><var>MODE</var> can have any of the following values:
  839. </p>
  840. <dl compact="compact">
  841. <dt><code>place</code></dt>
  842. <dd><p>Orphan sections are placed into a suitable output section following
  843. the strategy described in <a href="Orphan-Sections.html#Orphan-Sections">Orphan Sections</a>. The option
  844. &lsquo;<samp>--unique</samp>&rsquo; also effects how sections are placed.
  845. </p>
  846. </dd>
  847. <dt><code>discard</code></dt>
  848. <dd><p>All orphan sections are discarded, by placing them in the
  849. &lsquo;<samp>/DISCARD/</samp>&rsquo; section (see <a href="Output-Section-Discarding.html#Output-Section-Discarding">Output Section Discarding</a>).
  850. </p>
  851. </dd>
  852. <dt><code>warn</code></dt>
  853. <dd><p>The linker will place the orphan section as for <code>place</code> and also
  854. issue a warning.
  855. </p>
  856. </dd>
  857. <dt><code>error</code></dt>
  858. <dd><p>The linker will exit with an error if any orphan section is found.
  859. </p></dd>
  860. </dl>
  861. <p>The default if &lsquo;<samp>--orphan-handling</samp>&rsquo; is not given is <code>place</code>.
  862. </p>
  863. <a name="index-_002d_002dunique_005b_003dSECTION_005d"></a>
  864. </dd>
  865. <dt><code>--unique[=<var>SECTION</var>]</code></dt>
  866. <dd><p>Creates a separate output section for every input section matching
  867. <var>SECTION</var>, or if the optional wildcard <var>SECTION</var> argument is
  868. missing, for every orphan input section. An orphan section is one not
  869. specifically mentioned in a linker script. You may use this option
  870. multiple times on the command line; It prevents the normal merging of
  871. input sections with the same name, overriding output section assignments
  872. in a linker script.
  873. </p>
  874. <a name="index-_002dv"></a>
  875. <a name="index-_002dV"></a>
  876. <a name="index-_002d_002dversion"></a>
  877. <a name="index-version"></a>
  878. </dd>
  879. <dt><code>-v</code></dt>
  880. <dt><code>--version</code></dt>
  881. <dt><code>-V</code></dt>
  882. <dd><p>Display the version number for <code>ld</code>. The <samp>-V</samp> option also
  883. lists the supported emulations.
  884. </p>
  885. <a name="index-_002dx"></a>
  886. <a name="index-_002d_002ddiscard_002dall"></a>
  887. <a name="index-deleting-local-symbols"></a>
  888. </dd>
  889. <dt><code>-x</code></dt>
  890. <dt><code>--discard-all</code></dt>
  891. <dd><p>Delete all local symbols.
  892. </p>
  893. <a name="index-_002dX"></a>
  894. <a name="index-_002d_002ddiscard_002dlocals"></a>
  895. <a name="index-local-symbols_002c-deleting"></a>
  896. </dd>
  897. <dt><code>-X</code></dt>
  898. <dt><code>--discard-locals</code></dt>
  899. <dd><p>Delete all temporary local symbols. (These symbols start with
  900. system-specific local label prefixes, typically &lsquo;<samp>.L</samp>&rsquo; for ELF systems
  901. or &lsquo;<samp>L</samp>&rsquo; for traditional a.out systems.)
  902. </p>
  903. <a name="index-_002dy-symbol"></a>
  904. <a name="index-_002d_002dtrace_002dsymbol_003dsymbol"></a>
  905. <a name="index-symbol-tracing"></a>
  906. </dd>
  907. <dt><code>-y <var>symbol</var></code></dt>
  908. <dt><code>--trace-symbol=<var>symbol</var></code></dt>
  909. <dd><p>Print the name of each linked file in which <var>symbol</var> appears. This
  910. option may be given any number of times. On many systems it is necessary
  911. to prepend an underscore.
  912. </p>
  913. <p>This option is useful when you have an undefined symbol in your link but
  914. don&rsquo;t know where the reference is coming from.
  915. </p>
  916. <a name="index-_002dY-path"></a>
  917. </dd>
  918. <dt><code>-Y <var>path</var></code></dt>
  919. <dd><p>Add <var>path</var> to the default library search path. This option exists
  920. for Solaris compatibility.
  921. </p>
  922. <a name="index-_002dz-keyword"></a>
  923. </dd>
  924. <dt><code>-z <var>keyword</var></code></dt>
  925. <dd><p>The recognized keywords are:
  926. </p><dl compact="compact">
  927. <dt>&lsquo;<samp>combreloc</samp>&rsquo;</dt>
  928. <dd><p>Combines multiple reloc sections and sorts them to make dynamic symbol
  929. lookup caching possible.
  930. </p>
  931. </dd>
  932. <dt>&lsquo;<samp>common</samp>&rsquo;</dt>
  933. <dd><p>Generate common symbols with the STT_COMMON type druing a relocatable
  934. link.
  935. </p>
  936. </dd>
  937. <dt>&lsquo;<samp>defs</samp>&rsquo;</dt>
  938. <dd><p>Disallows undefined symbols in object files. Undefined symbols in
  939. shared libraries are still allowed.
  940. </p>
  941. </dd>
  942. <dt>&lsquo;<samp>execstack</samp>&rsquo;</dt>
  943. <dd><p>Marks the object as requiring executable stack.
  944. </p>
  945. </dd>
  946. <dt>&lsquo;<samp>global</samp>&rsquo;</dt>
  947. <dd><p>This option is only meaningful when building a shared object. It makes
  948. the symbols defined by this shared object available for symbol resolution
  949. of subsequently loaded libraries.
  950. </p>
  951. </dd>
  952. <dt>&lsquo;<samp>initfirst</samp>&rsquo;</dt>
  953. <dd><p>This option is only meaningful when building a shared object.
  954. It marks the object so that its runtime initialization will occur
  955. before the runtime initialization of any other objects brought into
  956. the process at the same time. Similarly the runtime finalization of
  957. the object will occur after the runtime finalization of any other
  958. objects.
  959. </p>
  960. </dd>
  961. <dt>&lsquo;<samp>interpose</samp>&rsquo;</dt>
  962. <dd><p>Marks the object that its symbol table interposes before all symbols
  963. but the primary executable.
  964. </p>
  965. </dd>
  966. <dt>&lsquo;<samp>lazy</samp>&rsquo;</dt>
  967. <dd><p>When generating an executable or shared library, mark it to tell the
  968. dynamic linker to defer function call resolution to the point when
  969. the function is called (lazy binding), rather than at load time.
  970. Lazy binding is the default.
  971. </p>
  972. </dd>
  973. <dt>&lsquo;<samp>loadfltr</samp>&rsquo;</dt>
  974. <dd><p>Marks the object that its filters be processed immediately at
  975. runtime.
  976. </p>
  977. </dd>
  978. <dt>&lsquo;<samp>muldefs</samp>&rsquo;</dt>
  979. <dd><p>Allows multiple definitions.
  980. </p>
  981. </dd>
  982. <dt>&lsquo;<samp>nocombreloc</samp>&rsquo;</dt>
  983. <dd><p>Disables multiple reloc sections combining.
  984. </p>
  985. </dd>
  986. <dt>&lsquo;<samp>nocommon</samp>&rsquo;</dt>
  987. <dd><p>Generate common symbols with the STT_OBJECT type druing a relocatable
  988. link.
  989. </p>
  990. </dd>
  991. <dt>&lsquo;<samp>nocopyreloc</samp>&rsquo;</dt>
  992. <dd><p>Disable linker generated .dynbss variables used in place of variables
  993. defined in shared libraries. May result in dynamic text relocations.
  994. </p>
  995. </dd>
  996. <dt>&lsquo;<samp>nodefaultlib</samp>&rsquo;</dt>
  997. <dd><p>Marks the object that the search for dependencies of this object will
  998. ignore any default library search paths.
  999. </p>
  1000. </dd>
  1001. <dt>&lsquo;<samp>nodelete</samp>&rsquo;</dt>
  1002. <dd><p>Marks the object shouldn&rsquo;t be unloaded at runtime.
  1003. </p>
  1004. </dd>
  1005. <dt>&lsquo;<samp>nodlopen</samp>&rsquo;</dt>
  1006. <dd><p>Marks the object not available to <code>dlopen</code>.
  1007. </p>
  1008. </dd>
  1009. <dt>&lsquo;<samp>nodump</samp>&rsquo;</dt>
  1010. <dd><p>Marks the object can not be dumped by <code>dldump</code>.
  1011. </p>
  1012. </dd>
  1013. <dt>&lsquo;<samp>noexecstack</samp>&rsquo;</dt>
  1014. <dd><p>Marks the object as not requiring executable stack.
  1015. </p>
  1016. </dd>
  1017. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  1018. <dd><p>Treat DT_TEXTREL in shared object as error.
  1019. </p>
  1020. </dd>
  1021. <dt>&lsquo;<samp>notext</samp>&rsquo;</dt>
  1022. <dd><p>Don&rsquo;t treat DT_TEXTREL in shared object as error.
  1023. </p>
  1024. </dd>
  1025. <dt>&lsquo;<samp>textoff</samp>&rsquo;</dt>
  1026. <dd><p>Don&rsquo;t treat DT_TEXTREL in shared object as error.
  1027. </p>
  1028. </dd>
  1029. <dt>&lsquo;<samp>norelro</samp>&rsquo;</dt>
  1030. <dd><p>Don&rsquo;t create an ELF <code>PT_GNU_RELRO</code> segment header in the object.
  1031. </p>
  1032. </dd>
  1033. <dt>&lsquo;<samp>now</samp>&rsquo;</dt>
  1034. <dd><p>When generating an executable or shared library, mark it to tell the
  1035. dynamic linker to resolve all symbols when the program is started, or
  1036. when the shared library is linked to using dlopen, instead of
  1037. deferring function call resolution to the point when the function is
  1038. first called.
  1039. </p>
  1040. </dd>
  1041. <dt>&lsquo;<samp>origin</samp>&rsquo;</dt>
  1042. <dd><p>Marks the object may contain $ORIGIN.
  1043. </p>
  1044. </dd>
  1045. <dt>&lsquo;<samp>relro</samp>&rsquo;</dt>
  1046. <dd><p>Create an ELF <code>PT_GNU_RELRO</code> segment header in the object.
  1047. </p>
  1048. </dd>
  1049. <dt>&lsquo;<samp>max-page-size=<var>value</var></samp>&rsquo;</dt>
  1050. <dd><p>Set the emulation maximum page size to <var>value</var>.
  1051. </p>
  1052. </dd>
  1053. <dt>&lsquo;<samp>common-page-size=<var>value</var></samp>&rsquo;</dt>
  1054. <dd><p>Set the emulation common page size to <var>value</var>.
  1055. </p>
  1056. </dd>
  1057. <dt>&lsquo;<samp>stack-size=<var>value</var></samp>&rsquo;</dt>
  1058. <dd><p>Specify a stack size for in an ELF <code>PT_GNU_STACK</code> segment.
  1059. Specifying zero will override any default non-zero sized
  1060. <code>PT_GNU_STACK</code> segment creation.
  1061. </p>
  1062. </dd>
  1063. <dt>&lsquo;<samp>bndplt</samp>&rsquo;</dt>
  1064. <dd><p>Always generate BND prefix in PLT entries. Supported for Linux/x86_64.
  1065. </p>
  1066. </dd>
  1067. <dt>&lsquo;<samp>noextern-protected-data</samp>&rsquo;</dt>
  1068. <dd><p>Don&rsquo;t treat protected data symbol as external when building shared
  1069. library. This option overrides linker backend default. It can be used
  1070. to workaround incorrect relocations against protected data symbols
  1071. generated by compiler. Updates on protected data symbols by another
  1072. module aren&rsquo;t visible to the resulting shared library. Supported for
  1073. i386 and x86-64.
  1074. </p>
  1075. </dd>
  1076. <dt>&lsquo;<samp>nodynamic-undefined-weak</samp>&rsquo;</dt>
  1077. <dd><p>Don&rsquo;t treat undefined weak symbols as dynamic when building executable.
  1078. This option overrides linker backend default. It can be used to avoid
  1079. dynamic relocations against undefined weak symbols in executable.
  1080. Supported for i386 and x86-64.
  1081. </p>
  1082. </dd>
  1083. <dt>&lsquo;<samp>noreloc-overflow</samp>&rsquo;</dt>
  1084. <dd><p>Disable relocation overflow check. This can be used to disable
  1085. relocation overflow check if there will be no dynamic relocation
  1086. overflow at run-time. Supported for x86_64.
  1087. </p>
  1088. </dd>
  1089. <dt>&lsquo;<samp>call-nop=prefix-addr</samp>&rsquo;</dt>
  1090. <dt>&lsquo;<samp>call-nop=suffix-nop</samp>&rsquo;</dt>
  1091. <dt>&lsquo;<samp>call-nop=prefix-<var>byte</var></samp>&rsquo;</dt>
  1092. <dt>&lsquo;<samp>call-nop=suffix-<var>byte</var></samp>&rsquo;</dt>
  1093. <dd><p>Specify the 1-byte <code>NOP</code> padding when transforming indirect call
  1094. to a locally defined function, foo, via its GOT slot.
  1095. <samp>call-nop=prefix-addr</samp> generates <code>0x67 call foo</code>.
  1096. <samp>call-nop=suffix-nop</samp> generates <code>call foo 0x90</code>.
  1097. <samp>call-nop=prefix-<var>byte</var></samp> generates <code><var>byte</var> call foo</code>.
  1098. <samp>call-nop=suffix-<var>byte</var></samp> generates <code>call foo <var>byte</var></code>.
  1099. Supported for i386 and x86_64.
  1100. </p>
  1101. </dd>
  1102. </dl>
  1103. <p>Other keywords are ignored for Solaris compatibility.
  1104. </p>
  1105. <a name="index-_002d_0028"></a>
  1106. <a name="index-groups-of-archives"></a>
  1107. </dd>
  1108. <dt><code>-( <var>archives</var> -)</code></dt>
  1109. <dt><code>--start-group <var>archives</var> --end-group</code></dt>
  1110. <dd><p>The <var>archives</var> should be a list of archive files. They may be
  1111. either explicit file names, or &lsquo;<samp>-l</samp>&rsquo; options.
  1112. </p>
  1113. <p>The specified archives are searched repeatedly until no new undefined
  1114. references are created. Normally, an archive is searched only once in
  1115. the order that it is specified on the command line. If a symbol in that
  1116. archive is needed to resolve an undefined symbol referred to by an
  1117. object in an archive that appears later on the command line, the linker
  1118. would not be able to resolve that reference. By grouping the archives,
  1119. they all be searched repeatedly until all possible references are
  1120. resolved.
  1121. </p>
  1122. <p>Using this option has a significant performance cost. It is best to use
  1123. it only when there are unavoidable circular references between two or
  1124. more archives.
  1125. </p>
  1126. <a name="index-_002d_002daccept_002dunknown_002dinput_002darch"></a>
  1127. <a name="index-_002d_002dno_002daccept_002dunknown_002dinput_002darch"></a>
  1128. </dd>
  1129. <dt><code>--accept-unknown-input-arch</code></dt>
  1130. <dt><code>--no-accept-unknown-input-arch</code></dt>
  1131. <dd><p>Tells the linker to accept input files whose architecture cannot be
  1132. recognised. The assumption is that the user knows what they are doing
  1133. and deliberately wants to link in these unknown input files. This was
  1134. the default behaviour of the linker, before release 2.14. The default
  1135. behaviour from release 2.14 onwards is to reject such input files, and
  1136. so the &lsquo;<samp>--accept-unknown-input-arch</samp>&rsquo; option has been added to
  1137. restore the old behaviour.
  1138. </p>
  1139. <a name="index-_002d_002das_002dneeded"></a>
  1140. <a name="index-_002d_002dno_002das_002dneeded"></a>
  1141. </dd>
  1142. <dt><code>--as-needed</code></dt>
  1143. <dt><code>--no-as-needed</code></dt>
  1144. <dd><p>This option affects ELF DT_NEEDED tags for dynamic libraries mentioned
  1145. on the command line after the <samp>--as-needed</samp> option. Normally
  1146. the linker will add a DT_NEEDED tag for each dynamic library mentioned
  1147. on the command line, regardless of whether the library is actually
  1148. needed or not. <samp>--as-needed</samp> causes a DT_NEEDED tag to only be
  1149. emitted for a library that <em>at that point in the link</em> satisfies a
  1150. non-weak undefined symbol reference from a regular object file or, if
  1151. the library is not found in the DT_NEEDED lists of other needed libraries, a
  1152. non-weak undefined symbol reference from another needed dynamic library.
  1153. Object files or libraries appearing on the command line <em>after</em>
  1154. the library in question do not affect whether the library is seen as
  1155. needed. This is similar to the rules for extraction of object files
  1156. from archives. <samp>--no-as-needed</samp> restores the default behaviour.
  1157. </p>
  1158. <a name="index-_002d_002dadd_002dneeded"></a>
  1159. <a name="index-_002d_002dno_002dadd_002dneeded"></a>
  1160. </dd>
  1161. <dt><code>--add-needed</code></dt>
  1162. <dt><code>--no-add-needed</code></dt>
  1163. <dd><p>These two options have been deprecated because of the similarity of
  1164. their names to the <samp>--as-needed</samp> and <samp>--no-as-needed</samp>
  1165. options. They have been replaced by <samp>--copy-dt-needed-entries</samp>
  1166. and <samp>--no-copy-dt-needed-entries</samp>.
  1167. </p>
  1168. <a name="index-_002dassert-keyword"></a>
  1169. </dd>
  1170. <dt><code>-assert <var>keyword</var></code></dt>
  1171. <dd><p>This option is ignored for SunOS compatibility.
  1172. </p>
  1173. <a name="index-_002dBdynamic"></a>
  1174. <a name="index-_002ddy"></a>
  1175. <a name="index-_002dcall_005fshared"></a>
  1176. </dd>
  1177. <dt><code>-Bdynamic</code></dt>
  1178. <dt><code>-dy</code></dt>
  1179. <dt><code>-call_shared</code></dt>
  1180. <dd><p>Link against dynamic libraries. This is only meaningful on platforms
  1181. for which shared libraries are supported. This option is normally the
  1182. default on such platforms. The different variants of this option are
  1183. for compatibility with various systems. You may use this option
  1184. multiple times on the command line: it affects library searching for
  1185. <samp>-l</samp> options which follow it.
  1186. </p>
  1187. <a name="index-_002dBgroup"></a>
  1188. </dd>
  1189. <dt><code>-Bgroup</code></dt>
  1190. <dd><p>Set the <code>DF_1_GROUP</code> flag in the <code>DT_FLAGS_1</code> entry in the dynamic
  1191. section. This causes the runtime linker to handle lookups in this
  1192. object and its dependencies to be performed only inside the group.
  1193. <samp>--unresolved-symbols=report-all</samp> is implied. This option is
  1194. only meaningful on ELF platforms which support shared libraries.
  1195. </p>
  1196. <a name="index-_002dBstatic"></a>
  1197. <a name="index-_002ddn"></a>
  1198. <a name="index-_002dnon_005fshared"></a>
  1199. <a name="index-_002dstatic"></a>
  1200. </dd>
  1201. <dt><code>-Bstatic</code></dt>
  1202. <dt><code>-dn</code></dt>
  1203. <dt><code>-non_shared</code></dt>
  1204. <dt><code>-static</code></dt>
  1205. <dd><p>Do not link against shared libraries. This is only meaningful on
  1206. platforms for which shared libraries are supported. The different
  1207. variants of this option are for compatibility with various systems. You
  1208. may use this option multiple times on the command line: it affects
  1209. library searching for <samp>-l</samp> options which follow it. This
  1210. option also implies <samp>--unresolved-symbols=report-all</samp>. This
  1211. option can be used with <samp>-shared</samp>. Doing so means that a
  1212. shared library is being created but that all of the library&rsquo;s external
  1213. references must be resolved by pulling in entries from static
  1214. libraries.
  1215. </p>
  1216. <a name="index-_002dBsymbolic"></a>
  1217. </dd>
  1218. <dt><code>-Bsymbolic</code></dt>
  1219. <dd><p>When creating a shared library, bind references to global symbols to the
  1220. definition within the shared library, if any. Normally, it is possible
  1221. for a program linked against a shared library to override the definition
  1222. within the shared library. This option can also be used with the
  1223. <samp>--export-dynamic</samp> option, when creating a position independent
  1224. executable, to bind references to global symbols to the definition within
  1225. the executable. This option is only meaningful on ELF platforms which
  1226. support shared libraries and position independent executables.
  1227. </p>
  1228. <a name="index-_002dBsymbolic_002dfunctions"></a>
  1229. </dd>
  1230. <dt><code>-Bsymbolic-functions</code></dt>
  1231. <dd><p>When creating a shared library, bind references to global function
  1232. symbols to the definition within the shared library, if any.
  1233. This option can also be used with the <samp>--export-dynamic</samp> option,
  1234. when creating a position independent executable, to bind references
  1235. to global function symbols to the definition within the executable.
  1236. This option is only meaningful on ELF platforms which support shared
  1237. libraries and position independent executables.
  1238. </p>
  1239. <a name="index-_002d_002ddynamic_002dlist_003ddynamic_002dlist_002dfile"></a>
  1240. </dd>
  1241. <dt><code>--dynamic-list=<var>dynamic-list-file</var></code></dt>
  1242. <dd><p>Specify the name of a dynamic list file to the linker. This is
  1243. typically used when creating shared libraries to specify a list of
  1244. global symbols whose references shouldn&rsquo;t be bound to the definition
  1245. within the shared library, or creating dynamically linked executables
  1246. to specify a list of symbols which should be added to the symbol table
  1247. in the executable. This option is only meaningful on ELF platforms
  1248. which support shared libraries.
  1249. </p>
  1250. <p>The format of the dynamic list is the same as the version node without
  1251. scope and node name. See <a href="VERSION.html#VERSION">VERSION</a> for more information.
  1252. </p>
  1253. <a name="index-_002d_002ddynamic_002dlist_002ddata"></a>
  1254. </dd>
  1255. <dt><code>--dynamic-list-data</code></dt>
  1256. <dd><p>Include all global data symbols to the dynamic list.
  1257. </p>
  1258. <a name="index-_002d_002ddynamic_002dlist_002dcpp_002dnew"></a>
  1259. </dd>
  1260. <dt><code>--dynamic-list-cpp-new</code></dt>
  1261. <dd><p>Provide the builtin dynamic list for C++ operator new and delete. It
  1262. is mainly useful for building shared libstdc++.
  1263. </p>
  1264. <a name="index-_002d_002ddynamic_002dlist_002dcpp_002dtypeinfo"></a>
  1265. </dd>
  1266. <dt><code>--dynamic-list-cpp-typeinfo</code></dt>
  1267. <dd><p>Provide the builtin dynamic list for C++ runtime type identification.
  1268. </p>
  1269. <a name="index-_002d_002dcheck_002dsections"></a>
  1270. <a name="index-_002d_002dno_002dcheck_002dsections"></a>
  1271. </dd>
  1272. <dt><code>--check-sections</code></dt>
  1273. <dt><code>--no-check-sections</code></dt>
  1274. <dd><p>Asks the linker <em>not</em> to check section addresses after they have
  1275. been assigned to see if there are any overlaps. Normally the linker will
  1276. perform this check, and if it finds any overlaps it will produce
  1277. suitable error messages. The linker does know about, and does make
  1278. allowances for sections in overlays. The default behaviour can be
  1279. restored by using the command line switch <samp>--check-sections</samp>.
  1280. Section overlap is not usually checked for relocatable links. You can
  1281. force checking in that case by using the <samp>--check-sections</samp>
  1282. option.
  1283. </p>
  1284. <a name="index-_002d_002dcopy_002ddt_002dneeded_002dentries"></a>
  1285. <a name="index-_002d_002dno_002dcopy_002ddt_002dneeded_002dentries"></a>
  1286. </dd>
  1287. <dt><code>--copy-dt-needed-entries</code></dt>
  1288. <dt><code>--no-copy-dt-needed-entries</code></dt>
  1289. <dd><p>This option affects the treatment of dynamic libraries referred to
  1290. by DT_NEEDED tags <em>inside</em> ELF dynamic libraries mentioned on the
  1291. command line. Normally the linker won&rsquo;t add a DT_NEEDED tag to the
  1292. output binary for each library mentioned in a DT_NEEDED tag in an
  1293. input dynamic library. With <samp>--copy-dt-needed-entries</samp>
  1294. specified on the command line however any dynamic libraries that
  1295. follow it will have their DT_NEEDED entries added. The default
  1296. behaviour can be restored with <samp>--no-copy-dt-needed-entries</samp>.
  1297. </p>
  1298. <p>This option also has an effect on the resolution of symbols in dynamic
  1299. libraries. With <samp>--copy-dt-needed-entries</samp> dynamic libraries
  1300. mentioned on the command line will be recursively searched, following
  1301. their DT_NEEDED tags to other libraries, in order to resolve symbols
  1302. required by the output binary. With the default setting however
  1303. the searching of dynamic libraries that follow it will stop with the
  1304. dynamic library itself. No DT_NEEDED links will be traversed to resolve
  1305. symbols.
  1306. </p>
  1307. <a name="index-cross-reference-table"></a>
  1308. <a name="index-_002d_002dcref"></a>
  1309. </dd>
  1310. <dt><code>--cref</code></dt>
  1311. <dd><p>Output a cross reference table. If a linker map file is being
  1312. generated, the cross reference table is printed to the map file.
  1313. Otherwise, it is printed on the standard output.
  1314. </p>
  1315. <p>The format of the table is intentionally simple, so that it may be
  1316. easily processed by a script if necessary. The symbols are printed out,
  1317. sorted by name. For each symbol, a list of file names is given. If the
  1318. symbol is defined, the first file listed is the location of the
  1319. definition. If the symbol is defined as a common value then any files
  1320. where this happens appear next. Finally any files that reference the
  1321. symbol are listed.
  1322. </p>
  1323. <a name="index-common-allocation-1"></a>
  1324. <a name="index-_002d_002dno_002ddefine_002dcommon"></a>
  1325. </dd>
  1326. <dt><code>--no-define-common</code></dt>
  1327. <dd><p>This option inhibits the assignment of addresses to common symbols.
  1328. The script command <code>INHIBIT_COMMON_ALLOCATION</code> has the same effect.
  1329. See <a href="Miscellaneous-Commands.html#Miscellaneous-Commands">Miscellaneous Commands</a>.
  1330. </p>
  1331. <p>The &lsquo;<samp>--no-define-common</samp>&rsquo; option allows decoupling
  1332. the decision to assign addresses to Common symbols from the choice
  1333. of the output file type; otherwise a non-Relocatable output type
  1334. forces assigning addresses to Common symbols.
  1335. Using &lsquo;<samp>--no-define-common</samp>&rsquo; allows Common symbols that are referenced
  1336. from a shared library to be assigned addresses only in the main program.
  1337. This eliminates the unused duplicate space in the shared library,
  1338. and also prevents any possible confusion over resolving to the wrong
  1339. duplicate when there are many dynamic modules with specialized search
  1340. paths for runtime symbol resolution.
  1341. </p>
  1342. <a name="index-symbols_002c-from-command-line"></a>
  1343. <a name="index-_002d_002ddefsym_003dsymbol_003dexp"></a>
  1344. </dd>
  1345. <dt><code>--defsym=<var>symbol</var>=<var>expression</var></code></dt>
  1346. <dd><p>Create a global symbol in the output file, containing the absolute
  1347. address given by <var>expression</var>. You may use this option as many
  1348. times as necessary to define multiple symbols in the command line. A
  1349. limited form of arithmetic is supported for the <var>expression</var> in this
  1350. context: you may give a hexadecimal constant or the name of an existing
  1351. symbol, or use <code>+</code> and <code>-</code> to add or subtract hexadecimal
  1352. constants or symbols. If you need more elaborate expressions, consider
  1353. using the linker command language from a script (see <a href="Assignments.html#Assignments">Assignments</a>).
  1354. <em>Note:</em> there should be no white space between <var>symbol</var>, the
  1355. equals sign (&ldquo;<tt class="key">=</tt>&rdquo;), and <var>expression</var>.
  1356. </p>
  1357. <a name="index-demangling_002c-from-command-line"></a>
  1358. <a name="index-_002d_002ddemangle_005b_003dstyle_005d"></a>
  1359. <a name="index-_002d_002dno_002ddemangle"></a>
  1360. </dd>
  1361. <dt><code>--demangle[=<var>style</var>]</code></dt>
  1362. <dt><code>--no-demangle</code></dt>
  1363. <dd><p>These options control whether to demangle symbol names in error messages
  1364. and other output. When the linker is told to demangle, it tries to
  1365. present symbol names in a readable fashion: it strips leading
  1366. underscores if they are used by the object file format, and converts C++
  1367. mangled symbol names into user readable names. Different compilers have
  1368. different mangling styles. The optional demangling style argument can be used
  1369. to choose an appropriate demangling style for your compiler. The linker will
  1370. demangle by default unless the environment variable &lsquo;<samp>COLLECT_NO_DEMANGLE</samp>&rsquo;
  1371. is set. These options may be used to override the default.
  1372. </p>
  1373. <a name="index-dynamic-linker_002c-from-command-line"></a>
  1374. <a name="index-_002dIfile"></a>
  1375. <a name="index-_002d_002ddynamic_002dlinker_003dfile"></a>
  1376. </dd>
  1377. <dt><code>-I<var>file</var></code></dt>
  1378. <dt><code>--dynamic-linker=<var>file</var></code></dt>
  1379. <dd><p>Set the name of the dynamic linker. This is only meaningful when
  1380. generating dynamically linked ELF executables. The default dynamic
  1381. linker is normally correct; don&rsquo;t use this unless you know what you are
  1382. doing.
  1383. </p>
  1384. <a name="index-_002d_002dno_002ddynamic_002dlinker"></a>
  1385. </dd>
  1386. <dt><code>--no-dynamic-linker</code></dt>
  1387. <dd><p>When producing an executable file, omit the request for a dynamic
  1388. linker to be used at load-time. This is only meaningful for ELF
  1389. executables that contain dynamic relocations, and usually requires
  1390. entry point code that is capable of processing these relocations.
  1391. </p>
  1392. <a name="index-_002d_002dfatal_002dwarnings"></a>
  1393. <a name="index-_002d_002dno_002dfatal_002dwarnings"></a>
  1394. </dd>
  1395. <dt><code>--fatal-warnings</code></dt>
  1396. <dt><code>--no-fatal-warnings</code></dt>
  1397. <dd><p>Treat all warnings as errors. The default behaviour can be restored
  1398. with the option <samp>--no-fatal-warnings</samp>.
  1399. </p>
  1400. <a name="index-_002d_002dforce_002dexe_002dsuffix"></a>
  1401. </dd>
  1402. <dt><code>--force-exe-suffix</code></dt>
  1403. <dd><p>Make sure that an output file has a .exe suffix.
  1404. </p>
  1405. <p>If a successfully built fully linked output file does not have a
  1406. <code>.exe</code> or <code>.dll</code> suffix, this option forces the linker to copy
  1407. the output file to one of the same name with a <code>.exe</code> suffix. This
  1408. option is useful when using unmodified Unix makefiles on a Microsoft
  1409. Windows host, since some versions of Windows won&rsquo;t run an image unless
  1410. it ends in a <code>.exe</code> suffix.
  1411. </p>
  1412. <a name="index-_002d_002dgc_002dsections"></a>
  1413. <a name="index-_002d_002dno_002dgc_002dsections"></a>
  1414. <a name="index-garbage-collection"></a>
  1415. </dd>
  1416. <dt><code>--gc-sections</code></dt>
  1417. <dt><code>--no-gc-sections</code></dt>
  1418. <dd><p>Enable garbage collection of unused input sections. It is ignored on
  1419. targets that do not support this option. The default behaviour (of not
  1420. performing this garbage collection) can be restored by specifying
  1421. &lsquo;<samp>--no-gc-sections</samp>&rsquo; on the command line. Note that garbage
  1422. collection for COFF and PE format targets is supported, but the
  1423. implementation is currently considered to be experimental.
  1424. </p>
  1425. <p>&lsquo;<samp>--gc-sections</samp>&rsquo; decides which input sections are used by
  1426. examining symbols and relocations. The section containing the entry
  1427. symbol and all sections containing symbols undefined on the
  1428. command-line will be kept, as will sections containing symbols
  1429. referenced by dynamic objects. Note that when building shared
  1430. libraries, the linker must assume that any visible symbol is
  1431. referenced. Once this initial set of sections has been determined,
  1432. the linker recursively marks as used any section referenced by their
  1433. relocations. See &lsquo;<samp>--entry</samp>&rsquo; and &lsquo;<samp>--undefined</samp>&rsquo;.
  1434. </p>
  1435. <p>This option can be set when doing a partial link (enabled with option
  1436. &lsquo;<samp>-r</samp>&rsquo;). In this case the root of symbols kept must be explicitly
  1437. specified either by an &lsquo;<samp>--entry</samp>&rsquo; or &lsquo;<samp>--undefined</samp>&rsquo; option or by
  1438. a <code>ENTRY</code> command in the linker script.
  1439. </p>
  1440. <a name="index-_002d_002dprint_002dgc_002dsections"></a>
  1441. <a name="index-_002d_002dno_002dprint_002dgc_002dsections"></a>
  1442. <a name="index-garbage-collection-1"></a>
  1443. </dd>
  1444. <dt><code>--print-gc-sections</code></dt>
  1445. <dt><code>--no-print-gc-sections</code></dt>
  1446. <dd><p>List all sections removed by garbage collection. The listing is
  1447. printed on stderr. This option is only effective if garbage
  1448. collection has been enabled via the &lsquo;<samp>--gc-sections</samp>&rsquo;) option. The
  1449. default behaviour (of not listing the sections that are removed) can
  1450. be restored by specifying &lsquo;<samp>--no-print-gc-sections</samp>&rsquo; on the command
  1451. line.
  1452. </p>
  1453. <a name="index-_002d_002dgc_002dkeep_002dexported"></a>
  1454. <a name="index-garbage-collection-2"></a>
  1455. </dd>
  1456. <dt><code>--gc-keep-exported</code></dt>
  1457. <dd><p>When &lsquo;<samp>--gc-sections</samp>&rsquo; is enabled, this option prevents garbage
  1458. collection of unused input sections that contain global symbols having
  1459. default or protected visibility. This option is intended to be used for
  1460. executables where unreferenced sections would otherwise be garbage
  1461. collected regardless of the external visibility of contained symbols.
  1462. Note that this option has no effect when linking shared objects since
  1463. it is already the default behaviour. This option is only supported for
  1464. ELF format targets.
  1465. </p>
  1466. <a name="index-_002d_002dprint_002doutput_002dformat"></a>
  1467. <a name="index-output-format"></a>
  1468. </dd>
  1469. <dt><code>--print-output-format</code></dt>
  1470. <dd><p>Print the name of the default output format (perhaps influenced by
  1471. other command-line options). This is the string that would appear
  1472. in an <code>OUTPUT_FORMAT</code> linker script command (see <a href="File-Commands.html#File-Commands">File Commands</a>).
  1473. </p>
  1474. <a name="index-_002d_002dprint_002dmemory_002dusage"></a>
  1475. <a name="index-memory-usage"></a>
  1476. </dd>
  1477. <dt><code>--print-memory-usage</code></dt>
  1478. <dd><p>Print used size, total size and used size of memory regions created with
  1479. the <a href="MEMORY.html#MEMORY">MEMORY</a> command. This is useful on embedded targets to have a
  1480. quick view of amount of free memory. The format of the output has one
  1481. headline and one line per region. It is both human readable and easily
  1482. parsable by tools. Here is an example of an output:
  1483. </p>
  1484. <div class="smallexample">
  1485. <pre class="smallexample">Memory region Used Size Region Size %age Used
  1486. ROM: 256 KB 1 MB 25.00%
  1487. RAM: 32 B 2 GB 0.00%
  1488. </pre></div>
  1489. <a name="index-help"></a>
  1490. <a name="index-usage"></a>
  1491. <a name="index-_002d_002dhelp"></a>
  1492. </dd>
  1493. <dt><code>--help</code></dt>
  1494. <dd><p>Print a summary of the command-line options on the standard output and exit.
  1495. </p>
  1496. <a name="index-_002d_002dtarget_002dhelp"></a>
  1497. </dd>
  1498. <dt><code>--target-help</code></dt>
  1499. <dd><p>Print a summary of all target specific options on the standard output and exit.
  1500. </p>
  1501. <a name="index-_002dMap_003dmapfile"></a>
  1502. </dd>
  1503. <dt><code>-Map=<var>mapfile</var></code></dt>
  1504. <dd><p>Print a link map to the file <var>mapfile</var>. See the description of the
  1505. <samp>-M</samp> option, above.
  1506. </p>
  1507. <a name="index-memory-usage-1"></a>
  1508. <a name="index-_002d_002dno_002dkeep_002dmemory"></a>
  1509. </dd>
  1510. <dt><code>--no-keep-memory</code></dt>
  1511. <dd><p><code>ld</code> normally optimizes for speed over memory usage by caching the
  1512. symbol tables of input files in memory. This option tells <code>ld</code> to
  1513. instead optimize for memory usage, by rereading the symbol tables as
  1514. necessary. This may be required if <code>ld</code> runs out of memory space
  1515. while linking a large executable.
  1516. </p>
  1517. <a name="index-_002d_002dno_002dundefined"></a>
  1518. <a name="index-_002dz-defs"></a>
  1519. </dd>
  1520. <dt><code>--no-undefined</code></dt>
  1521. <dt><code>-z defs</code></dt>
  1522. <dd><p>Report unresolved symbol references from regular object files. This
  1523. is done even if the linker is creating a non-symbolic shared library.
  1524. The switch <samp>--[no-]allow-shlib-undefined</samp> controls the
  1525. behaviour for reporting unresolved references found in shared
  1526. libraries being linked in.
  1527. </p>
  1528. <a name="index-_002d_002dallow_002dmultiple_002ddefinition"></a>
  1529. <a name="index-_002dz-muldefs"></a>
  1530. </dd>
  1531. <dt><code>--allow-multiple-definition</code></dt>
  1532. <dt><code>-z muldefs</code></dt>
  1533. <dd><p>Normally when a symbol is defined multiple times, the linker will
  1534. report a fatal error. These options allow multiple definitions and the
  1535. first definition will be used.
  1536. </p>
  1537. <a name="index-_002d_002dallow_002dshlib_002dundefined"></a>
  1538. <a name="index-_002d_002dno_002dallow_002dshlib_002dundefined"></a>
  1539. </dd>
  1540. <dt><code>--allow-shlib-undefined</code></dt>
  1541. <dt><code>--no-allow-shlib-undefined</code></dt>
  1542. <dd><p>Allows or disallows undefined symbols in shared libraries.
  1543. This switch is similar to <samp>--no-undefined</samp> except that it
  1544. determines the behaviour when the undefined symbols are in a
  1545. shared library rather than a regular object file. It does not affect
  1546. how undefined symbols in regular object files are handled.
  1547. </p>
  1548. <p>The default behaviour is to report errors for any undefined symbols
  1549. referenced in shared libraries if the linker is being used to create
  1550. an executable, but to allow them if the linker is being used to create
  1551. a shared library.
  1552. </p>
  1553. <p>The reasons for allowing undefined symbol references in shared
  1554. libraries specified at link time are that:
  1555. </p>
  1556. <ul>
  1557. <li> A shared library specified at link time may not be the same as the one
  1558. that is available at load time, so the symbol might actually be
  1559. resolvable at load time.
  1560. </li><li> There are some operating systems, eg BeOS and HPPA, where undefined
  1561. symbols in shared libraries are normal.
  1562. <p>The BeOS kernel for example patches shared libraries at load time to
  1563. select whichever function is most appropriate for the current
  1564. architecture. This is used, for example, to dynamically select an
  1565. appropriate memset function.
  1566. </p></li></ul>
  1567. <a name="index-_002d_002dno_002dundefined_002dversion"></a>
  1568. </dd>
  1569. <dt><code>--no-undefined-version</code></dt>
  1570. <dd><p>Normally when a symbol has an undefined version, the linker will ignore
  1571. it. This option disallows symbols with undefined version and a fatal error
  1572. will be issued instead.
  1573. </p>
  1574. <a name="index-_002d_002ddefault_002dsymver"></a>
  1575. </dd>
  1576. <dt><code>--default-symver</code></dt>
  1577. <dd><p>Create and use a default symbol version (the soname) for unversioned
  1578. exported symbols.
  1579. </p>
  1580. <a name="index-_002d_002ddefault_002dimported_002dsymver"></a>
  1581. </dd>
  1582. <dt><code>--default-imported-symver</code></dt>
  1583. <dd><p>Create and use a default symbol version (the soname) for unversioned
  1584. imported symbols.
  1585. </p>
  1586. <a name="index-_002d_002dno_002dwarn_002dmismatch"></a>
  1587. </dd>
  1588. <dt><code>--no-warn-mismatch</code></dt>
  1589. <dd><p>Normally <code>ld</code> will give an error if you try to link together input
  1590. files that are mismatched for some reason, perhaps because they have
  1591. been compiled for different processors or for different endiannesses.
  1592. This option tells <code>ld</code> that it should silently permit such possible
  1593. errors. This option should only be used with care, in cases when you
  1594. have taken some special action that ensures that the linker errors are
  1595. inappropriate.
  1596. </p>
  1597. <a name="index-_002d_002dno_002dwarn_002dsearch_002dmismatch"></a>
  1598. </dd>
  1599. <dt><code>--no-warn-search-mismatch</code></dt>
  1600. <dd><p>Normally <code>ld</code> will give a warning if it finds an incompatible
  1601. library during a library search. This option silences the warning.
  1602. </p>
  1603. <a name="index-_002d_002dno_002dwhole_002darchive"></a>
  1604. </dd>
  1605. <dt><code>--no-whole-archive</code></dt>
  1606. <dd><p>Turn off the effect of the <samp>--whole-archive</samp> option for subsequent
  1607. archive files.
  1608. </p>
  1609. <a name="index-output-file-after-errors"></a>
  1610. <a name="index-_002d_002dnoinhibit_002dexec"></a>
  1611. </dd>
  1612. <dt><code>--noinhibit-exec</code></dt>
  1613. <dd><p>Retain the executable output file whenever it is still usable.
  1614. Normally, the linker will not produce an output file if it encounters
  1615. errors during the link process; it exits without writing an output file
  1616. when it issues any error whatsoever.
  1617. </p>
  1618. <a name="index-_002dnostdlib"></a>
  1619. </dd>
  1620. <dt><code>-nostdlib</code></dt>
  1621. <dd><p>Only search library directories explicitly specified on the
  1622. command line. Library directories specified in linker scripts
  1623. (including linker scripts specified on the command line) are ignored.
  1624. </p>
  1625. <a name="index-_002d_002doformat_003doutput_002dformat"></a>
  1626. </dd>
  1627. <dt><code>--oformat=<var>output-format</var></code></dt>
  1628. <dd><p><code>ld</code> may be configured to support more than one kind of object
  1629. file. If your <code>ld</code> is configured this way, you can use the
  1630. &lsquo;<samp>--oformat</samp>&rsquo; option to specify the binary format for the output
  1631. object file. Even when <code>ld</code> is configured to support alternative
  1632. object formats, you don&rsquo;t usually need to specify this, as <code>ld</code>
  1633. should be configured to produce as a default output format the most
  1634. usual format on each machine. <var>output-format</var> is a text string, the
  1635. name of a particular format supported by the BFD libraries. (You can
  1636. list the available binary formats with &lsquo;<samp>objdump -i</samp>&rsquo;.) The script
  1637. command <code>OUTPUT_FORMAT</code> can also specify the output format, but
  1638. this option overrides it. See <a href="BFD.html#BFD">BFD</a>.
  1639. </p>
  1640. <a name="index-_002d_002dout_002dimplib"></a>
  1641. </dd>
  1642. <dt><code>--out-implib <var>file</var></code></dt>
  1643. <dd><p>Create an import library in <var>file</var> corresponding to the executable
  1644. the linker is generating (eg. a DLL or ELF program). This import
  1645. library (which should be called <code>*.dll.a</code> or <code>*.a</code> for DLLs)
  1646. may be used to link clients against the generated executable; this
  1647. behaviour makes it possible to skip a separate import library creation
  1648. step (eg. <code>dlltool</code> for DLLs). This option is only available for
  1649. the i386 PE and ELF targetted ports of the linker.
  1650. </p>
  1651. <a name="index-_002dpie"></a>
  1652. <a name="index-_002d_002dpic_002dexecutable"></a>
  1653. </dd>
  1654. <dt><code>-pie</code></dt>
  1655. <dt><code>--pic-executable</code></dt>
  1656. <dd><a name="index-position-independent-executables"></a>
  1657. <p>Create a position independent executable. This is currently only supported on
  1658. ELF platforms. Position independent executables are similar to shared
  1659. libraries in that they are relocated by the dynamic linker to the virtual
  1660. address the OS chooses for them (which can vary between invocations). Like
  1661. normal dynamically linked executables they can be executed and symbols
  1662. defined in the executable cannot be overridden by shared libraries.
  1663. </p>
  1664. <a name="index-_002dqmagic"></a>
  1665. </dd>
  1666. <dt><code>-qmagic</code></dt>
  1667. <dd><p>This option is ignored for Linux compatibility.
  1668. </p>
  1669. <a name="index-_002dQy"></a>
  1670. </dd>
  1671. <dt><code>-Qy</code></dt>
  1672. <dd><p>This option is ignored for SVR4 compatibility.
  1673. </p>
  1674. <a name="index-_002d_002drelax"></a>
  1675. <a name="index-synthesizing-linker"></a>
  1676. <a name="index-relaxing-addressing-modes"></a>
  1677. <a name="index-_002d_002dno_002drelax"></a>
  1678. </dd>
  1679. <dt><code>--relax</code></dt>
  1680. <dt><code>--no-relax</code></dt>
  1681. <dd><p>An option with machine dependent effects.
  1682. This option is only supported on a few targets.
  1683. See <a href="H8_002f300.html#H8_002f300"><code>ld</code> and the H8/300</a>.
  1684. See <a href="i960.html#i960"><code>ld</code> and the Intel 960 family</a>.
  1685. See <a href="Xtensa.html#Xtensa"><code>ld</code> and Xtensa Processors</a>.
  1686. See <a href="M68HC11_002f68HC12.html#M68HC11_002f68HC12"><code>ld</code> and the 68HC11 and 68HC12</a>.
  1687. See <a href="Nios-II.html#Nios-II"><code>ld</code> and the Altera Nios II</a>.
  1688. See <a href="PowerPC-ELF32.html#PowerPC-ELF32"><code>ld</code> and PowerPC 32-bit ELF Support</a>.
  1689. </p>
  1690. <p>On some platforms the &lsquo;<samp>--relax</samp>&rsquo; option performs target specific,
  1691. global optimizations that become possible when the linker resolves
  1692. addressing in the program, such as relaxing address modes,
  1693. synthesizing new instructions, selecting shorter version of current
  1694. instructions, and combining constant values.
  1695. </p>
  1696. <p>On some platforms these link time global optimizations may make symbolic
  1697. debugging of the resulting executable impossible.
  1698. This is known to be the case for the Matsushita MN10200 and MN10300
  1699. family of processors.
  1700. </p>
  1701. <p>On platforms where this is not supported, &lsquo;<samp>--relax</samp>&rsquo; is accepted,
  1702. but ignored.
  1703. </p>
  1704. <p>On platforms where &lsquo;<samp>--relax</samp>&rsquo; is accepted the option
  1705. &lsquo;<samp>--no-relax</samp>&rsquo; can be used to disable the feature.
  1706. </p>
  1707. <a name="index-retaining-specified-symbols"></a>
  1708. <a name="index-stripping-all-but-some-symbols"></a>
  1709. <a name="index-symbols_002c-retaining-selectively"></a>
  1710. <a name="index-_002d_002dretain_002dsymbols_002dfile_003dfilename"></a>
  1711. </dd>
  1712. <dt><code>--retain-symbols-file=<var>filename</var></code></dt>
  1713. <dd><p>Retain <em>only</em> the symbols listed in the file <var>filename</var>,
  1714. discarding all others. <var>filename</var> is simply a flat file, with one
  1715. symbol name per line. This option is especially useful in environments
  1716. (such as VxWorks)
  1717. where a large global symbol table is accumulated gradually, to conserve
  1718. run-time memory.
  1719. </p>
  1720. <p>&lsquo;<samp>--retain-symbols-file</samp>&rsquo; does <em>not</em> discard undefined symbols,
  1721. or symbols needed for relocations.
  1722. </p>
  1723. <p>You may only specify &lsquo;<samp>--retain-symbols-file</samp>&rsquo; once in the command
  1724. line. It overrides &lsquo;<samp>-s</samp>&rsquo; and &lsquo;<samp>-S</samp>&rsquo;.
  1725. </p>
  1726. </dd>
  1727. <dt><code>-rpath=<var>dir</var></code></dt>
  1728. <dd><a name="index-runtime-library-search-path"></a>
  1729. <a name="index-_002drpath_003ddir"></a>
  1730. <p>Add a directory to the runtime library search path. This is used when
  1731. linking an ELF executable with shared objects. All <samp>-rpath</samp>
  1732. arguments are concatenated and passed to the runtime linker, which uses
  1733. them to locate shared objects at runtime. The <samp>-rpath</samp> option is
  1734. also used when locating shared objects which are needed by shared
  1735. objects explicitly included in the link; see the description of the
  1736. <samp>-rpath-link</samp> option. If <samp>-rpath</samp> is not used when linking an
  1737. ELF executable, the contents of the environment variable
  1738. <code>LD_RUN_PATH</code> will be used if it is defined.
  1739. </p>
  1740. <p>The <samp>-rpath</samp> option may also be used on SunOS. By default, on
  1741. SunOS, the linker will form a runtime search path out of all the
  1742. <samp>-L</samp> options it is given. If a <samp>-rpath</samp> option is used, the
  1743. runtime search path will be formed exclusively using the <samp>-rpath</samp>
  1744. options, ignoring the <samp>-L</samp> options. This can be useful when using
  1745. gcc, which adds many <samp>-L</samp> options which may be on NFS mounted
  1746. file systems.
  1747. </p>
  1748. <p>For compatibility with other ELF linkers, if the <samp>-R</samp> option is
  1749. followed by a directory name, rather than a file name, it is treated as
  1750. the <samp>-rpath</samp> option.
  1751. </p>
  1752. <a name="index-link_002dtime-runtime-library-search-path"></a>
  1753. <a name="index-_002drpath_002dlink_003ddir"></a>
  1754. </dd>
  1755. <dt><code>-rpath-link=<var>dir</var></code></dt>
  1756. <dd><p>When using ELF or SunOS, one shared library may require another. This
  1757. happens when an <code>ld -shared</code> link includes a shared library as one
  1758. of the input files.
  1759. </p>
  1760. <p>When the linker encounters such a dependency when doing a non-shared,
  1761. non-relocatable link, it will automatically try to locate the required
  1762. shared library and include it in the link, if it is not included
  1763. explicitly. In such a case, the <samp>-rpath-link</samp> option
  1764. specifies the first set of directories to search. The
  1765. <samp>-rpath-link</samp> option may specify a sequence of directory names
  1766. either by specifying a list of names separated by colons, or by
  1767. appearing multiple times.
  1768. </p>
  1769. <p>The tokens <var>$ORIGIN</var> and <var>$LIB</var> can appear in these search
  1770. directories. They will be replaced by the full path to the directory
  1771. containing the program or shared object in the case of <var>$ORIGIN</var>
  1772. and either &lsquo;<samp>lib</samp>&rsquo; - for 32-bit binaries - or &lsquo;<samp>lib64</samp>&rsquo; - for
  1773. 64-bit binaries - in the case of <var>$LIB</var>.
  1774. </p>
  1775. <p>The alternative form of these tokens - <var>${ORIGIN}</var> and
  1776. <var>${LIB}</var> can also be used. The token <var>$PLATFORM</var> is not
  1777. supported.
  1778. </p>
  1779. <p>This option should be used with caution as it overrides the search path
  1780. that may have been hard compiled into a shared library. In such a case it
  1781. is possible to use unintentionally a different search path than the
  1782. runtime linker would do.
  1783. </p>
  1784. <p>The linker uses the following search paths to locate required shared
  1785. libraries:
  1786. </p><ol>
  1787. <li> Any directories specified by <samp>-rpath-link</samp> options.
  1788. </li><li> Any directories specified by <samp>-rpath</samp> options. The difference
  1789. between <samp>-rpath</samp> and <samp>-rpath-link</samp> is that directories
  1790. specified by <samp>-rpath</samp> options are included in the executable and
  1791. used at runtime, whereas the <samp>-rpath-link</samp> option is only effective
  1792. at link time. Searching <samp>-rpath</samp> in this way is only supported
  1793. by native linkers and cross linkers which have been configured with
  1794. the <samp>--with-sysroot</samp> option.
  1795. </li><li> On an ELF system, for native linkers, if the <samp>-rpath</samp> and
  1796. <samp>-rpath-link</samp> options were not used, search the contents of the
  1797. environment variable <code>LD_RUN_PATH</code>.
  1798. </li><li> On SunOS, if the <samp>-rpath</samp> option was not used, search any
  1799. directories specified using <samp>-L</samp> options.
  1800. </li><li> For a native linker, search the contents of the environment
  1801. variable <code>LD_LIBRARY_PATH</code>.
  1802. </li><li> For a native ELF linker, the directories in <code>DT_RUNPATH</code> or
  1803. <code>DT_RPATH</code> of a shared library are searched for shared
  1804. libraries needed by it. The <code>DT_RPATH</code> entries are ignored if
  1805. <code>DT_RUNPATH</code> entries exist.
  1806. </li><li> The default directories, normally <samp>/lib</samp> and <samp>/usr/lib</samp>.
  1807. </li><li> For a native linker on an ELF system, if the file <samp>/etc/ld.so.conf</samp>
  1808. exists, the list of directories found in that file.
  1809. </li></ol>
  1810. <p>If the required shared library is not found, the linker will issue a
  1811. warning and continue with the link.
  1812. </p>
  1813. <a name="index-_002dshared"></a>
  1814. <a name="index-_002dBshareable"></a>
  1815. </dd>
  1816. <dt><code>-shared</code></dt>
  1817. <dt><code>-Bshareable</code></dt>
  1818. <dd><a name="index-shared-libraries"></a>
  1819. <p>Create a shared library. This is currently only supported on ELF, XCOFF
  1820. and SunOS platforms. On SunOS, the linker will automatically create a
  1821. shared library if the <samp>-e</samp> option is not used and there are
  1822. undefined symbols in the link.
  1823. </p>
  1824. <a name="index-_002d_002dsort_002dcommon"></a>
  1825. </dd>
  1826. <dt><code>--sort-common</code></dt>
  1827. <dt><code>--sort-common=ascending</code></dt>
  1828. <dt><code>--sort-common=descending</code></dt>
  1829. <dd><p>This option tells <code>ld</code> to sort the common symbols by alignment in
  1830. ascending or descending order when it places them in the appropriate output
  1831. sections. The symbol alignments considered are sixteen-byte or larger,
  1832. eight-byte, four-byte, two-byte, and one-byte. This is to prevent gaps
  1833. between symbols due to alignment constraints. If no sorting order is
  1834. specified, then descending order is assumed.
  1835. </p>
  1836. <a name="index-_002d_002dsort_002dsection_003dname"></a>
  1837. </dd>
  1838. <dt><code>--sort-section=name</code></dt>
  1839. <dd><p>This option will apply <code>SORT_BY_NAME</code> to all wildcard section
  1840. patterns in the linker script.
  1841. </p>
  1842. <a name="index-_002d_002dsort_002dsection_003dalignment"></a>
  1843. </dd>
  1844. <dt><code>--sort-section=alignment</code></dt>
  1845. <dd><p>This option will apply <code>SORT_BY_ALIGNMENT</code> to all wildcard section
  1846. patterns in the linker script.
  1847. </p>
  1848. <a name="index-_002d_002dsplit_002dby_002dfile"></a>
  1849. </dd>
  1850. <dt><code>--split-by-file[=<var>size</var>]</code></dt>
  1851. <dd><p>Similar to <samp>--split-by-reloc</samp> but creates a new output section for
  1852. each input file when <var>size</var> is reached. <var>size</var> defaults to a
  1853. size of 1 if not given.
  1854. </p>
  1855. <a name="index-_002d_002dsplit_002dby_002dreloc"></a>
  1856. </dd>
  1857. <dt><code>--split-by-reloc[=<var>count</var>]</code></dt>
  1858. <dd><p>Tries to creates extra sections in the output file so that no single
  1859. output section in the file contains more than <var>count</var> relocations.
  1860. This is useful when generating huge relocatable files for downloading into
  1861. certain real time kernels with the COFF object file format; since COFF
  1862. cannot represent more than 65535 relocations in a single section. Note
  1863. that this will fail to work with object file formats which do not
  1864. support arbitrary sections. The linker will not split up individual
  1865. input sections for redistribution, so if a single input section contains
  1866. more than <var>count</var> relocations one output section will contain that
  1867. many relocations. <var>count</var> defaults to a value of 32768.
  1868. </p>
  1869. <a name="index-_002d_002dstats"></a>
  1870. </dd>
  1871. <dt><code>--stats</code></dt>
  1872. <dd><p>Compute and display statistics about the operation of the linker, such
  1873. as execution time and memory usage.
  1874. </p>
  1875. <a name="index-_002d_002dsysroot_003ddirectory"></a>
  1876. </dd>
  1877. <dt><code>--sysroot=<var>directory</var></code></dt>
  1878. <dd><p>Use <var>directory</var> as the location of the sysroot, overriding the
  1879. configure-time default. This option is only supported by linkers
  1880. that were configured using <samp>--with-sysroot</samp>.
  1881. </p>
  1882. <a name="index-_002d_002dtraditional_002dformat"></a>
  1883. <a name="index-traditional-format"></a>
  1884. </dd>
  1885. <dt><code>--traditional-format</code></dt>
  1886. <dd><p>For some targets, the output of <code>ld</code> is different in some ways from
  1887. the output of some existing linker. This switch requests <code>ld</code> to
  1888. use the traditional format instead.
  1889. </p>
  1890. <a name="index-dbx"></a>
  1891. <p>For example, on SunOS, <code>ld</code> combines duplicate entries in the
  1892. symbol string table. This can reduce the size of an output file with
  1893. full debugging information by over 30 percent. Unfortunately, the SunOS
  1894. <code>dbx</code> program can not read the resulting program (<code>gdb</code> has no
  1895. trouble). The &lsquo;<samp>--traditional-format</samp>&rsquo; switch tells <code>ld</code> to not
  1896. combine duplicate entries.
  1897. </p>
  1898. <a name="index-_002d_002dsection_002dstart_003dsectionname_003dorg"></a>
  1899. </dd>
  1900. <dt><code>--section-start=<var>sectionname</var>=<var>org</var></code></dt>
  1901. <dd><p>Locate a section in the output file at the absolute
  1902. address given by <var>org</var>. You may use this option as many
  1903. times as necessary to locate multiple sections in the command
  1904. line.
  1905. <var>org</var> must be a single hexadecimal integer;
  1906. for compatibility with other linkers, you may omit the leading
  1907. &lsquo;<samp>0x</samp>&rsquo; usually associated with hexadecimal values. <em>Note:</em> there
  1908. should be no white space between <var>sectionname</var>, the equals
  1909. sign (&ldquo;<tt class="key">=</tt>&rdquo;), and <var>org</var>.
  1910. </p>
  1911. <a name="index-_002dTbss_003dorg"></a>
  1912. <a name="index-_002dTdata_003dorg"></a>
  1913. <a name="index-_002dTtext_003dorg"></a>
  1914. <a name="index-segment-origins_002c-cmd-line"></a>
  1915. </dd>
  1916. <dt><code>-Tbss=<var>org</var></code></dt>
  1917. <dt><code>-Tdata=<var>org</var></code></dt>
  1918. <dt><code>-Ttext=<var>org</var></code></dt>
  1919. <dd><p>Same as <samp>--section-start</samp>, with <code>.bss</code>, <code>.data</code> or
  1920. <code>.text</code> as the <var>sectionname</var>.
  1921. </p>
  1922. <a name="index-_002dTtext_002dsegment_003dorg"></a>
  1923. </dd>
  1924. <dt><code>-Ttext-segment=<var>org</var></code></dt>
  1925. <dd><a name="index-text-segment-origin_002c-cmd-line"></a>
  1926. <p>When creating an ELF executable, it will set the address of the first
  1927. byte of the text segment.
  1928. </p>
  1929. <a name="index-_002dTrodata_002dsegment_003dorg"></a>
  1930. </dd>
  1931. <dt><code>-Trodata-segment=<var>org</var></code></dt>
  1932. <dd><a name="index-rodata-segment-origin_002c-cmd-line"></a>
  1933. <p>When creating an ELF executable or shared object for a target where
  1934. the read-only data is in its own segment separate from the executable
  1935. text, it will set the address of the first byte of the read-only data segment.
  1936. </p>
  1937. <a name="index-_002dTldata_002dsegment_003dorg"></a>
  1938. </dd>
  1939. <dt><code>-Tldata-segment=<var>org</var></code></dt>
  1940. <dd><a name="index-ldata-segment-origin_002c-cmd-line"></a>
  1941. <p>When creating an ELF executable or shared object for x86-64 medium memory
  1942. model, it will set the address of the first byte of the ldata segment.
  1943. </p>
  1944. <a name="index-_002d_002dunresolved_002dsymbols"></a>
  1945. </dd>
  1946. <dt><code>--unresolved-symbols=<var>method</var></code></dt>
  1947. <dd><p>Determine how to handle unresolved symbols. There are four possible
  1948. values for &lsquo;<samp>method</samp>&rsquo;:
  1949. </p>
  1950. <dl compact="compact">
  1951. <dt>&lsquo;<samp>ignore-all</samp>&rsquo;</dt>
  1952. <dd><p>Do not report any unresolved symbols.
  1953. </p>
  1954. </dd>
  1955. <dt>&lsquo;<samp>report-all</samp>&rsquo;</dt>
  1956. <dd><p>Report all unresolved symbols. This is the default.
  1957. </p>
  1958. </dd>
  1959. <dt>&lsquo;<samp>ignore-in-object-files</samp>&rsquo;</dt>
  1960. <dd><p>Report unresolved symbols that are contained in shared libraries, but
  1961. ignore them if they come from regular object files.
  1962. </p>
  1963. </dd>
  1964. <dt>&lsquo;<samp>ignore-in-shared-libs</samp>&rsquo;</dt>
  1965. <dd><p>Report unresolved symbols that come from regular object files, but
  1966. ignore them if they come from shared libraries. This can be useful
  1967. when creating a dynamic binary and it is known that all the shared
  1968. libraries that it should be referencing are included on the linker&rsquo;s
  1969. command line.
  1970. </p></dd>
  1971. </dl>
  1972. <p>The behaviour for shared libraries on their own can also be controlled
  1973. by the <samp>--[no-]allow-shlib-undefined</samp> option.
  1974. </p>
  1975. <p>Normally the linker will generate an error message for each reported
  1976. unresolved symbol but the option <samp>--warn-unresolved-symbols</samp>
  1977. can change this to a warning.
  1978. </p>
  1979. <a name="index-_002d_002dverbose_005b_003dNUMBER_005d"></a>
  1980. <a name="index-verbose_005b_003dNUMBER_005d"></a>
  1981. </dd>
  1982. <dt><code>--dll-verbose</code></dt>
  1983. <dt><code>--verbose[=<var>NUMBER</var>]</code></dt>
  1984. <dd><p>Display the version number for <code>ld</code> and list the linker emulations
  1985. supported. Display which input files can and cannot be opened. Display
  1986. the linker script being used by the linker. If the optional <var>NUMBER</var>
  1987. argument &gt; 1, plugin symbol status will also be displayed.
  1988. </p>
  1989. <a name="index-_002d_002dversion_002dscript_003dversion_002dscriptfile"></a>
  1990. <a name="index-version-script_002c-symbol-versions"></a>
  1991. </dd>
  1992. <dt><code>--version-script=<var>version-scriptfile</var></code></dt>
  1993. <dd><p>Specify the name of a version script to the linker. This is typically
  1994. used when creating shared libraries to specify additional information
  1995. about the version hierarchy for the library being created. This option
  1996. is only fully supported on ELF platforms which support shared libraries;
  1997. see <a href="VERSION.html#VERSION">VERSION</a>. It is partially supported on PE platforms, which can
  1998. use version scripts to filter symbol visibility in auto-export mode: any
  1999. symbols marked &lsquo;<samp>local</samp>&rsquo; in the version script will not be exported.
  2000. See <a href="WIN32.html#WIN32">WIN32</a>.
  2001. </p>
  2002. <a name="index-_002d_002dwarn_002dcommon"></a>
  2003. <a name="index-warnings_002c-on-combining-symbols"></a>
  2004. <a name="index-combining-symbols_002c-warnings-on"></a>
  2005. </dd>
  2006. <dt><code>--warn-common</code></dt>
  2007. <dd><p>Warn when a common symbol is combined with another common symbol or with
  2008. a symbol definition. Unix linkers allow this somewhat sloppy practice,
  2009. but linkers on some other operating systems do not. This option allows
  2010. you to find potential problems from combining global symbols.
  2011. Unfortunately, some C libraries use this practice, so you may get some
  2012. warnings about symbols in the libraries as well as in your programs.
  2013. </p>
  2014. <p>There are three kinds of global symbols, illustrated here by C examples:
  2015. </p>
  2016. <dl compact="compact">
  2017. <dt>&lsquo;<samp>int i = 1;</samp>&rsquo;</dt>
  2018. <dd><p>A definition, which goes in the initialized data section of the output
  2019. file.
  2020. </p>
  2021. </dd>
  2022. <dt>&lsquo;<samp>extern int i;</samp>&rsquo;</dt>
  2023. <dd><p>An undefined reference, which does not allocate space.
  2024. There must be either a definition or a common symbol for the
  2025. variable somewhere.
  2026. </p>
  2027. </dd>
  2028. <dt>&lsquo;<samp>int i;</samp>&rsquo;</dt>
  2029. <dd><p>A common symbol. If there are only (one or more) common symbols for a
  2030. variable, it goes in the uninitialized data area of the output file.
  2031. The linker merges multiple common symbols for the same variable into a
  2032. single symbol. If they are of different sizes, it picks the largest
  2033. size. The linker turns a common symbol into a declaration, if there is
  2034. a definition of the same variable.
  2035. </p></dd>
  2036. </dl>
  2037. <p>The &lsquo;<samp>--warn-common</samp>&rsquo; option can produce five kinds of warnings.
  2038. Each warning consists of a pair of lines: the first describes the symbol
  2039. just encountered, and the second describes the previous symbol
  2040. encountered with the same name. One or both of the two symbols will be
  2041. a common symbol.
  2042. </p>
  2043. <ol>
  2044. <li> Turning a common symbol into a reference, because there is already a
  2045. definition for the symbol.
  2046. <div class="smallexample">
  2047. <pre class="smallexample"><var>file</var>(<var>section</var>): warning: common of `<var>symbol</var>'
  2048. overridden by definition
  2049. <var>file</var>(<var>section</var>): warning: defined here
  2050. </pre></div>
  2051. </li><li> Turning a common symbol into a reference, because a later definition for
  2052. the symbol is encountered. This is the same as the previous case,
  2053. except that the symbols are encountered in a different order.
  2054. <div class="smallexample">
  2055. <pre class="smallexample"><var>file</var>(<var>section</var>): warning: definition of `<var>symbol</var>'
  2056. overriding common
  2057. <var>file</var>(<var>section</var>): warning: common is here
  2058. </pre></div>
  2059. </li><li> Merging a common symbol with a previous same-sized common symbol.
  2060. <div class="smallexample">
  2061. <pre class="smallexample"><var>file</var>(<var>section</var>): warning: multiple common
  2062. of `<var>symbol</var>'
  2063. <var>file</var>(<var>section</var>): warning: previous common is here
  2064. </pre></div>
  2065. </li><li> Merging a common symbol with a previous larger common symbol.
  2066. <div class="smallexample">
  2067. <pre class="smallexample"><var>file</var>(<var>section</var>): warning: common of `<var>symbol</var>'
  2068. overridden by larger common
  2069. <var>file</var>(<var>section</var>): warning: larger common is here
  2070. </pre></div>
  2071. </li><li> Merging a common symbol with a previous smaller common symbol. This is
  2072. the same as the previous case, except that the symbols are
  2073. encountered in a different order.
  2074. <div class="smallexample">
  2075. <pre class="smallexample"><var>file</var>(<var>section</var>): warning: common of `<var>symbol</var>'
  2076. overriding smaller common
  2077. <var>file</var>(<var>section</var>): warning: smaller common is here
  2078. </pre></div>
  2079. </li></ol>
  2080. <a name="index-_002d_002dwarn_002dconstructors"></a>
  2081. </dd>
  2082. <dt><code>--warn-constructors</code></dt>
  2083. <dd><p>Warn if any global constructors are used. This is only useful for a few
  2084. object file formats. For formats like COFF or ELF, the linker can not
  2085. detect the use of global constructors.
  2086. </p>
  2087. <a name="index-_002d_002dwarn_002dmultiple_002dgp"></a>
  2088. </dd>
  2089. <dt><code>--warn-multiple-gp</code></dt>
  2090. <dd><p>Warn if multiple global pointer values are required in the output file.
  2091. This is only meaningful for certain processors, such as the Alpha.
  2092. Specifically, some processors put large-valued constants in a special
  2093. section. A special register (the global pointer) points into the middle
  2094. of this section, so that constants can be loaded efficiently via a
  2095. base-register relative addressing mode. Since the offset in
  2096. base-register relative mode is fixed and relatively small (e.g., 16
  2097. bits), this limits the maximum size of the constant pool. Thus, in
  2098. large programs, it is often necessary to use multiple global pointer
  2099. values in order to be able to address all possible constants. This
  2100. option causes a warning to be issued whenever this case occurs.
  2101. </p>
  2102. <a name="index-_002d_002dwarn_002donce"></a>
  2103. <a name="index-warnings_002c-on-undefined-symbols"></a>
  2104. <a name="index-undefined-symbols_002c-warnings-on"></a>
  2105. </dd>
  2106. <dt><code>--warn-once</code></dt>
  2107. <dd><p>Only warn once for each undefined symbol, rather than once per module
  2108. which refers to it.
  2109. </p>
  2110. <a name="index-_002d_002dwarn_002dsection_002dalign"></a>
  2111. <a name="index-warnings_002c-on-section-alignment"></a>
  2112. <a name="index-section-alignment_002c-warnings-on"></a>
  2113. </dd>
  2114. <dt><code>--warn-section-align</code></dt>
  2115. <dd><p>Warn if the address of an output section is changed because of
  2116. alignment. Typically, the alignment will be set by an input section.
  2117. The address will only be changed if it not explicitly specified; that
  2118. is, if the <code>SECTIONS</code> command does not specify a start address for
  2119. the section (see <a href="SECTIONS.html#SECTIONS">SECTIONS</a>).
  2120. </p>
  2121. <a name="index-_002d_002dwarn_002dshared_002dtextrel"></a>
  2122. </dd>
  2123. <dt><code>--warn-shared-textrel</code></dt>
  2124. <dd><p>Warn if the linker adds a DT_TEXTREL to a shared object.
  2125. </p>
  2126. <a name="index-_002d_002dwarn_002dalternate_002dem"></a>
  2127. </dd>
  2128. <dt><code>--warn-alternate-em</code></dt>
  2129. <dd><p>Warn if an object has alternate ELF machine code.
  2130. </p>
  2131. <a name="index-_002d_002dwarn_002dunresolved_002dsymbols"></a>
  2132. </dd>
  2133. <dt><code>--warn-unresolved-symbols</code></dt>
  2134. <dd><p>If the linker is going to report an unresolved symbol (see the option
  2135. <samp>--unresolved-symbols</samp>) it will normally generate an error.
  2136. This option makes it generate a warning instead.
  2137. </p>
  2138. <a name="index-_002d_002derror_002dunresolved_002dsymbols"></a>
  2139. </dd>
  2140. <dt><code>--error-unresolved-symbols</code></dt>
  2141. <dd><p>This restores the linker&rsquo;s default behaviour of generating errors when
  2142. it is reporting unresolved symbols.
  2143. </p>
  2144. <a name="index-_002d_002dwhole_002darchive"></a>
  2145. <a name="index-including-an-entire-archive"></a>
  2146. </dd>
  2147. <dt><code>--whole-archive</code></dt>
  2148. <dd><p>For each archive mentioned on the command line after the
  2149. <samp>--whole-archive</samp> option, include every object file in the archive
  2150. in the link, rather than searching the archive for the required object
  2151. files. This is normally used to turn an archive file into a shared
  2152. library, forcing every object to be included in the resulting shared
  2153. library. This option may be used more than once.
  2154. </p>
  2155. <p>Two notes when using this option from gcc: First, gcc doesn&rsquo;t know
  2156. about this option, so you have to use <samp>-Wl,-whole-archive</samp>.
  2157. Second, don&rsquo;t forget to use <samp>-Wl,-no-whole-archive</samp> after your
  2158. list of archives, because gcc will add its own list of archives to
  2159. your link and you may not want this flag to affect those as well.
  2160. </p>
  2161. <a name="index-_002d_002dwrap_003dsymbol"></a>
  2162. </dd>
  2163. <dt><code>--wrap=<var>symbol</var></code></dt>
  2164. <dd><p>Use a wrapper function for <var>symbol</var>. Any undefined reference to
  2165. <var>symbol</var> will be resolved to <code>__wrap_<var>symbol</var></code>. Any
  2166. undefined reference to <code>__real_<var>symbol</var></code> will be resolved to
  2167. <var>symbol</var>.
  2168. </p>
  2169. <p>This can be used to provide a wrapper for a system function. The
  2170. wrapper function should be called <code>__wrap_<var>symbol</var></code>. If it
  2171. wishes to call the system function, it should call
  2172. <code>__real_<var>symbol</var></code>.
  2173. </p>
  2174. <p>Here is a trivial example:
  2175. </p>
  2176. <div class="smallexample">
  2177. <pre class="smallexample">void *
  2178. __wrap_malloc (size_t c)
  2179. {
  2180. printf (&quot;malloc called with %zu\n&quot;, c);
  2181. return __real_malloc (c);
  2182. }
  2183. </pre></div>
  2184. <p>If you link other code with this file using <samp>--wrap malloc</samp>, then
  2185. all calls to <code>malloc</code> will call the function <code>__wrap_malloc</code>
  2186. instead. The call to <code>__real_malloc</code> in <code>__wrap_malloc</code> will
  2187. call the real <code>malloc</code> function.
  2188. </p>
  2189. <p>You may wish to provide a <code>__real_malloc</code> function as well, so that
  2190. links without the <samp>--wrap</samp> option will succeed. If you do this,
  2191. you should not put the definition of <code>__real_malloc</code> in the same
  2192. file as <code>__wrap_malloc</code>; if you do, the assembler may resolve the
  2193. call before the linker has a chance to wrap it to <code>malloc</code>.
  2194. </p>
  2195. <a name="index-_002d_002deh_002dframe_002dhdr"></a>
  2196. <a name="index-_002d_002dno_002deh_002dframe_002dhdr"></a>
  2197. </dd>
  2198. <dt><code>--eh-frame-hdr</code></dt>
  2199. <dt><code>--no-eh-frame-hdr</code></dt>
  2200. <dd><p>Request (<samp>--eh-frame-hdr</samp>) or suppress
  2201. (<samp>--no-eh-frame-hdr</samp>) the creation of <code>.eh_frame_hdr</code>
  2202. section and ELF <code>PT_GNU_EH_FRAME</code> segment header.
  2203. </p>
  2204. <a name="index-_002d_002dld_002dgenerated_002dunwind_002dinfo"></a>
  2205. </dd>
  2206. <dt><code>--no-ld-generated-unwind-info</code></dt>
  2207. <dd><p>Request creation of <code>.eh_frame</code> unwind info for linker
  2208. generated code sections like PLT. This option is on by default
  2209. if linker generated unwind info is supported.
  2210. </p>
  2211. <a name="index-_002d_002denable_002dnew_002ddtags"></a>
  2212. <a name="index-_002d_002ddisable_002dnew_002ddtags"></a>
  2213. </dd>
  2214. <dt><code>--enable-new-dtags</code></dt>
  2215. <dt><code>--disable-new-dtags</code></dt>
  2216. <dd><p>This linker can create the new dynamic tags in ELF. But the older ELF
  2217. systems may not understand them. If you specify
  2218. <samp>--enable-new-dtags</samp>, the new dynamic tags will be created as needed
  2219. and older dynamic tags will be omitted.
  2220. If you specify <samp>--disable-new-dtags</samp>, no new dynamic tags will be
  2221. created. By default, the new dynamic tags are not created. Note that
  2222. those options are only available for ELF systems.
  2223. </p>
  2224. <a name="index-_002d_002dhash_002dsize_003dnumber"></a>
  2225. </dd>
  2226. <dt><code>--hash-size=<var>number</var></code></dt>
  2227. <dd><p>Set the default size of the linker&rsquo;s hash tables to a prime number
  2228. close to <var>number</var>. Increasing this value can reduce the length of
  2229. time it takes the linker to perform its tasks, at the expense of
  2230. increasing the linker&rsquo;s memory requirements. Similarly reducing this
  2231. value can reduce the memory requirements at the expense of speed.
  2232. </p>
  2233. <a name="index-_002d_002dhash_002dstyle_003dstyle"></a>
  2234. </dd>
  2235. <dt><code>--hash-style=<var>style</var></code></dt>
  2236. <dd><p>Set the type of linker&rsquo;s hash table(s). <var>style</var> can be either
  2237. <code>sysv</code> for classic ELF <code>.hash</code> section, <code>gnu</code> for
  2238. new style GNU <code>.gnu.hash</code> section or <code>both</code> for both
  2239. the classic ELF <code>.hash</code> and new style GNU <code>.gnu.hash</code>
  2240. hash tables. The default is <code>sysv</code>.
  2241. </p>
  2242. <a name="index-_002d_002dcompress_002ddebug_002dsections_003dnone"></a>
  2243. <a name="index-_002d_002dcompress_002ddebug_002dsections_003dzlib"></a>
  2244. <a name="index-_002d_002dcompress_002ddebug_002dsections_003dzlib_002dgnu"></a>
  2245. <a name="index-_002d_002dcompress_002ddebug_002dsections_003dzlib_002dgabi"></a>
  2246. </dd>
  2247. <dt><code>--compress-debug-sections=none</code></dt>
  2248. <dt><code>--compress-debug-sections=zlib</code></dt>
  2249. <dt><code>--compress-debug-sections=zlib-gnu</code></dt>
  2250. <dt><code>--compress-debug-sections=zlib-gabi</code></dt>
  2251. <dd><p>On ELF platforms, these options control how DWARF debug sections are
  2252. compressed using zlib.
  2253. </p>
  2254. <p><samp>--compress-debug-sections=none</samp> doesn&rsquo;t compress DWARF debug
  2255. sections. <samp>--compress-debug-sections=zlib-gnu</samp> compresses
  2256. DWARF debug sections and renames them to begin with &lsquo;<samp>.zdebug</samp>&rsquo;
  2257. instead of &lsquo;<samp>.debug</samp>&rsquo;. <samp>--compress-debug-sections=zlib-gabi</samp>
  2258. also compresses DWARF debug sections, but rather than renaming them it
  2259. sets the SHF_COMPRESSED flag in the sections&rsquo; headers.
  2260. </p>
  2261. <p>The <samp>--compress-debug-sections=zlib</samp> option is an alias for
  2262. <samp>--compress-debug-sections=zlib-gabi</samp>.
  2263. </p>
  2264. <p>Note that this option overrides any compression in input debug
  2265. sections, so if a binary is linked with <samp>--compress-debug-sections=none</samp>
  2266. for example, then any compressed debug sections in input files will be
  2267. uncompressed before they are copied into the output binary.
  2268. </p>
  2269. <p>The default compression behaviour varies depending upon the target
  2270. involved and the configure options used to build the toolchain. The
  2271. default can be determined by examining the output from the linker&rsquo;s
  2272. <samp>--help</samp> option.
  2273. </p>
  2274. <a name="index-_002d_002dreduce_002dmemory_002doverheads"></a>
  2275. </dd>
  2276. <dt><code>--reduce-memory-overheads</code></dt>
  2277. <dd><p>This option reduces memory requirements at ld runtime, at the expense of
  2278. linking speed. This was introduced to select the old O(n^2) algorithm
  2279. for link map file generation, rather than the new O(n) algorithm which uses
  2280. about 40% more memory for symbol storage.
  2281. </p>
  2282. <p>Another effect of the switch is to set the default hash table size to
  2283. 1021, which again saves memory at the cost of lengthening the linker&rsquo;s
  2284. run time. This is not done however if the <samp>--hash-size</samp> switch
  2285. has been used.
  2286. </p>
  2287. <p>The <samp>--reduce-memory-overheads</samp> switch may be also be used to
  2288. enable other tradeoffs in future versions of the linker.
  2289. </p>
  2290. <a name="index-_002d_002dbuild_002did"></a>
  2291. <a name="index-_002d_002dbuild_002did_003dstyle"></a>
  2292. </dd>
  2293. <dt><code>--build-id</code></dt>
  2294. <dt><code>--build-id=<var>style</var></code></dt>
  2295. <dd><p>Request the creation of a <code>.note.gnu.build-id</code> ELF note section
  2296. or a <code>.buildid</code> COFF section. The contents of the note are
  2297. unique bits identifying this linked file. <var>style</var> can be
  2298. <code>uuid</code> to use 128 random bits, <code>sha1</code> to use a 160-bit
  2299. <small>SHA1</small> hash on the normative parts of the output contents,
  2300. <code>md5</code> to use a 128-bit <small>MD5</small> hash on the normative parts of
  2301. the output contents, or <code>0x<var>hexstring</var></code> to use a chosen bit
  2302. string specified as an even number of hexadecimal digits (<code>-</code> and
  2303. <code>:</code> characters between digit pairs are ignored). If <var>style</var>
  2304. is omitted, <code>sha1</code> is used.
  2305. </p>
  2306. <p>The <code>md5</code> and <code>sha1</code> styles produces an identifier
  2307. that is always the same in an identical output file, but will be
  2308. unique among all nonidentical output files. It is not intended
  2309. to be compared as a checksum for the file&rsquo;s contents. A linked
  2310. file may be changed later by other tools, but the build ID bit
  2311. string identifying the original linked file does not change.
  2312. </p>
  2313. <p>Passing <code>none</code> for <var>style</var> disables the setting from any
  2314. <code>--build-id</code> options earlier on the command line.
  2315. </p></dd>
  2316. </dl>
  2317. <a name="Options-Specific-to-i386-PE-Targets"></a>
  2318. <h4 class="subsection">2.1.1 Options Specific to i386 PE Targets</h4>
  2319. <p>The i386 PE linker supports the <samp>-shared</samp> option, which causes
  2320. the output to be a dynamically linked library (DLL) instead of a
  2321. normal executable. You should name the output <code>*.dll</code> when you
  2322. use this option. In addition, the linker fully supports the standard
  2323. <code>*.def</code> files, which may be specified on the linker command line
  2324. like an object file (in fact, it should precede archives it exports
  2325. symbols from, to ensure that they get linked in, just like a normal
  2326. object file).
  2327. </p>
  2328. <p>In addition to the options common to all targets, the i386 PE linker
  2329. support additional command line options that are specific to the i386
  2330. PE target. Options that take values may be separated from their
  2331. values by either a space or an equals sign.
  2332. </p>
  2333. <dl compact="compact">
  2334. <dd>
  2335. <a name="index-_002d_002dadd_002dstdcall_002dalias"></a>
  2336. </dd>
  2337. <dt><code>--add-stdcall-alias</code></dt>
  2338. <dd><p>If given, symbols with a stdcall suffix (@<var>nn</var>) will be exported
  2339. as-is and also with the suffix stripped.
  2340. [This option is specific to the i386 PE targeted port of the linker]
  2341. </p>
  2342. <a name="index-_002d_002dbase_002dfile"></a>
  2343. </dd>
  2344. <dt><code>--base-file <var>file</var></code></dt>
  2345. <dd><p>Use <var>file</var> as the name of a file in which to save the base
  2346. addresses of all the relocations needed for generating DLLs with
  2347. <samp>dlltool</samp>.
  2348. [This is an i386 PE specific option]
  2349. </p>
  2350. <a name="index-_002d_002ddll"></a>
  2351. </dd>
  2352. <dt><code>--dll</code></dt>
  2353. <dd><p>Create a DLL instead of a regular executable. You may also use
  2354. <samp>-shared</samp> or specify a <code>LIBRARY</code> in a given <code>.def</code>
  2355. file.
  2356. [This option is specific to the i386 PE targeted port of the linker]
  2357. </p>
  2358. <a name="index-_002d_002denable_002dlong_002dsection_002dnames"></a>
  2359. <a name="index-_002d_002ddisable_002dlong_002dsection_002dnames"></a>
  2360. </dd>
  2361. <dt><code>--enable-long-section-names</code></dt>
  2362. <dt><code>--disable-long-section-names</code></dt>
  2363. <dd><p>The PE variants of the COFF object format add an extension that permits
  2364. the use of section names longer than eight characters, the normal limit
  2365. for COFF. By default, these names are only allowed in object files, as
  2366. fully-linked executable images do not carry the COFF string table required
  2367. to support the longer names. As a GNU extension, it is possible to
  2368. allow their use in executable images as well, or to (probably pointlessly!)
  2369. disallow it in object files, by using these two options. Executable images
  2370. generated with these long section names are slightly non-standard, carrying
  2371. as they do a string table, and may generate confusing output when examined
  2372. with non-GNU PE-aware tools, such as file viewers and dumpers. However,
  2373. GDB relies on the use of PE long section names to find Dwarf-2 debug
  2374. information sections in an executable image at runtime, and so if neither
  2375. option is specified on the command-line, <code>ld</code> will enable long
  2376. section names, overriding the default and technically correct behaviour,
  2377. when it finds the presence of debug information while linking an executable
  2378. image and not stripping symbols.
  2379. [This option is valid for all PE targeted ports of the linker]
  2380. </p>
  2381. <a name="index-_002d_002denable_002dstdcall_002dfixup"></a>
  2382. <a name="index-_002d_002ddisable_002dstdcall_002dfixup"></a>
  2383. </dd>
  2384. <dt><code>--enable-stdcall-fixup</code></dt>
  2385. <dt><code>--disable-stdcall-fixup</code></dt>
  2386. <dd><p>If the link finds a symbol that it cannot resolve, it will attempt to
  2387. do &ldquo;fuzzy linking&rdquo; by looking for another defined symbol that differs
  2388. only in the format of the symbol name (cdecl vs stdcall) and will
  2389. resolve that symbol by linking to the match. For example, the
  2390. undefined symbol <code>_foo</code> might be linked to the function
  2391. <code>_foo@12</code>, or the undefined symbol <code>_bar@16</code> might be linked
  2392. to the function <code>_bar</code>. When the linker does this, it prints a
  2393. warning, since it normally should have failed to link, but sometimes
  2394. import libraries generated from third-party dlls may need this feature
  2395. to be usable. If you specify <samp>--enable-stdcall-fixup</samp>, this
  2396. feature is fully enabled and warnings are not printed. If you specify
  2397. <samp>--disable-stdcall-fixup</samp>, this feature is disabled and such
  2398. mismatches are considered to be errors.
  2399. [This option is specific to the i386 PE targeted port of the linker]
  2400. </p>
  2401. <a name="index-_002d_002dleading_002dunderscore"></a>
  2402. <a name="index-_002d_002dno_002dleading_002dunderscore"></a>
  2403. </dd>
  2404. <dt><code>--leading-underscore</code></dt>
  2405. <dt><code>--no-leading-underscore</code></dt>
  2406. <dd><p>For most targets default symbol-prefix is an underscore and is defined
  2407. in target&rsquo;s description. By this option it is possible to
  2408. disable/enable the default underscore symbol-prefix.
  2409. </p>
  2410. <a name="index-DLLs_002c-creating"></a>
  2411. <a name="index-_002d_002dexport_002dall_002dsymbols"></a>
  2412. </dd>
  2413. <dt><code>--export-all-symbols</code></dt>
  2414. <dd><p>If given, all global symbols in the objects used to build a DLL will
  2415. be exported by the DLL. Note that this is the default if there
  2416. otherwise wouldn&rsquo;t be any exported symbols. When symbols are
  2417. explicitly exported via DEF files or implicitly exported via function
  2418. attributes, the default is to not export anything else unless this
  2419. option is given. Note that the symbols <code>DllMain@12</code>,
  2420. <code>DllEntryPoint@0</code>, <code>DllMainCRTStartup@12</code>, and
  2421. <code>impure_ptr</code> will not be automatically
  2422. exported. Also, symbols imported from other DLLs will not be
  2423. re-exported, nor will symbols specifying the DLL&rsquo;s internal layout
  2424. such as those beginning with <code>_head_</code> or ending with
  2425. <code>_iname</code>. In addition, no symbols from <code>libgcc</code>,
  2426. <code>libstd++</code>, <code>libmingw32</code>, or <code>crtX.o</code> will be exported.
  2427. Symbols whose names begin with <code>__rtti_</code> or <code>__builtin_</code> will
  2428. not be exported, to help with C++ DLLs. Finally, there is an
  2429. extensive list of cygwin-private symbols that are not exported
  2430. (obviously, this applies on when building DLLs for cygwin targets).
  2431. These cygwin-excludes are: <code>_cygwin_dll_entry@12</code>,
  2432. <code>_cygwin_crt0_common@8</code>, <code>_cygwin_noncygwin_dll_entry@12</code>,
  2433. <code>_fmode</code>, <code>_impure_ptr</code>, <code>cygwin_attach_dll</code>,
  2434. <code>cygwin_premain0</code>, <code>cygwin_premain1</code>, <code>cygwin_premain2</code>,
  2435. <code>cygwin_premain3</code>, and <code>environ</code>.
  2436. [This option is specific to the i386 PE targeted port of the linker]
  2437. </p>
  2438. <a name="index-_002d_002dexclude_002dsymbols"></a>
  2439. </dd>
  2440. <dt><code>--exclude-symbols <var>symbol</var>,<var>symbol</var>,...</code></dt>
  2441. <dd><p>Specifies a list of symbols which should not be automatically
  2442. exported. The symbol names may be delimited by commas or colons.
  2443. [This option is specific to the i386 PE targeted port of the linker]
  2444. </p>
  2445. <a name="index-_002d_002dexclude_002dall_002dsymbols"></a>
  2446. </dd>
  2447. <dt><code>--exclude-all-symbols</code></dt>
  2448. <dd><p>Specifies no symbols should be automatically exported.
  2449. [This option is specific to the i386 PE targeted port of the linker]
  2450. </p>
  2451. <a name="index-_002d_002dfile_002dalignment"></a>
  2452. </dd>
  2453. <dt><code>--file-alignment</code></dt>
  2454. <dd><p>Specify the file alignment. Sections in the file will always begin at
  2455. file offsets which are multiples of this number. This defaults to
  2456. 512.
  2457. [This option is specific to the i386 PE targeted port of the linker]
  2458. </p>
  2459. <a name="index-heap-size"></a>
  2460. <a name="index-_002d_002dheap"></a>
  2461. </dd>
  2462. <dt><code>--heap <var>reserve</var></code></dt>
  2463. <dt><code>--heap <var>reserve</var>,<var>commit</var></code></dt>
  2464. <dd><p>Specify the number of bytes of memory to reserve (and optionally commit)
  2465. to be used as heap for this program. The default is 1MB reserved, 4K
  2466. committed.
  2467. [This option is specific to the i386 PE targeted port of the linker]
  2468. </p>
  2469. <a name="index-image-base"></a>
  2470. <a name="index-_002d_002dimage_002dbase"></a>
  2471. </dd>
  2472. <dt><code>--image-base <var>value</var></code></dt>
  2473. <dd><p>Use <var>value</var> as the base address of your program or dll. This is
  2474. the lowest memory location that will be used when your program or dll
  2475. is loaded. To reduce the need to relocate and improve performance of
  2476. your dlls, each should have a unique base address and not overlap any
  2477. other dlls. The default is 0x400000 for executables, and 0x10000000
  2478. for dlls.
  2479. [This option is specific to the i386 PE targeted port of the linker]
  2480. </p>
  2481. <a name="index-_002d_002dkill_002dat"></a>
  2482. </dd>
  2483. <dt><code>--kill-at</code></dt>
  2484. <dd><p>If given, the stdcall suffixes (@<var>nn</var>) will be stripped from
  2485. symbols before they are exported.
  2486. [This option is specific to the i386 PE targeted port of the linker]
  2487. </p>
  2488. <a name="index-_002d_002dlarge_002daddress_002daware"></a>
  2489. </dd>
  2490. <dt><code>--large-address-aware</code></dt>
  2491. <dd><p>If given, the appropriate bit in the &ldquo;Characteristics&rdquo; field of the COFF
  2492. header is set to indicate that this executable supports virtual addresses
  2493. greater than 2 gigabytes. This should be used in conjunction with the /3GB
  2494. or /USERVA=<var>value</var> megabytes switch in the &ldquo;[operating systems]&rdquo;
  2495. section of the BOOT.INI. Otherwise, this bit has no effect.
  2496. [This option is specific to PE targeted ports of the linker]
  2497. </p>
  2498. <a name="index-_002d_002ddisable_002dlarge_002daddress_002daware"></a>
  2499. </dd>
  2500. <dt><code>--disable-large-address-aware</code></dt>
  2501. <dd><p>Reverts the effect of a previous &lsquo;<samp>--large-address-aware</samp>&rsquo; option.
  2502. This is useful if &lsquo;<samp>--large-address-aware</samp>&rsquo; is always set by the compiler
  2503. driver (e.g. Cygwin gcc) and the executable does not support virtual
  2504. addresses greater than 2 gigabytes.
  2505. [This option is specific to PE targeted ports of the linker]
  2506. </p>
  2507. <a name="index-_002d_002dmajor_002dimage_002dversion"></a>
  2508. </dd>
  2509. <dt><code>--major-image-version <var>value</var></code></dt>
  2510. <dd><p>Sets the major number of the &ldquo;image version&rdquo;. Defaults to 1.
  2511. [This option is specific to the i386 PE targeted port of the linker]
  2512. </p>
  2513. <a name="index-_002d_002dmajor_002dos_002dversion"></a>
  2514. </dd>
  2515. <dt><code>--major-os-version <var>value</var></code></dt>
  2516. <dd><p>Sets the major number of the &ldquo;os version&rdquo;. Defaults to 4.
  2517. [This option is specific to the i386 PE targeted port of the linker]
  2518. </p>
  2519. <a name="index-_002d_002dmajor_002dsubsystem_002dversion"></a>
  2520. </dd>
  2521. <dt><code>--major-subsystem-version <var>value</var></code></dt>
  2522. <dd><p>Sets the major number of the &ldquo;subsystem version&rdquo;. Defaults to 4.
  2523. [This option is specific to the i386 PE targeted port of the linker]
  2524. </p>
  2525. <a name="index-_002d_002dminor_002dimage_002dversion"></a>
  2526. </dd>
  2527. <dt><code>--minor-image-version <var>value</var></code></dt>
  2528. <dd><p>Sets the minor number of the &ldquo;image version&rdquo;. Defaults to 0.
  2529. [This option is specific to the i386 PE targeted port of the linker]
  2530. </p>
  2531. <a name="index-_002d_002dminor_002dos_002dversion"></a>
  2532. </dd>
  2533. <dt><code>--minor-os-version <var>value</var></code></dt>
  2534. <dd><p>Sets the minor number of the &ldquo;os version&rdquo;. Defaults to 0.
  2535. [This option is specific to the i386 PE targeted port of the linker]
  2536. </p>
  2537. <a name="index-_002d_002dminor_002dsubsystem_002dversion"></a>
  2538. </dd>
  2539. <dt><code>--minor-subsystem-version <var>value</var></code></dt>
  2540. <dd><p>Sets the minor number of the &ldquo;subsystem version&rdquo;. Defaults to 0.
  2541. [This option is specific to the i386 PE targeted port of the linker]
  2542. </p>
  2543. <a name="index-DEF-files_002c-creating"></a>
  2544. <a name="index-DLLs_002c-creating-1"></a>
  2545. <a name="index-_002d_002doutput_002ddef"></a>
  2546. </dd>
  2547. <dt><code>--output-def <var>file</var></code></dt>
  2548. <dd><p>The linker will create the file <var>file</var> which will contain a DEF
  2549. file corresponding to the DLL the linker is generating. This DEF file
  2550. (which should be called <code>*.def</code>) may be used to create an import
  2551. library with <code>dlltool</code> or may be used as a reference to
  2552. automatically or implicitly exported symbols.
  2553. [This option is specific to the i386 PE targeted port of the linker]
  2554. </p>
  2555. <a name="index-DLLs_002c-creating-2"></a>
  2556. <a name="index-_002d_002denable_002dauto_002dimage_002dbase"></a>
  2557. </dd>
  2558. <dt><code>--enable-auto-image-base</code></dt>
  2559. <dt><code>--enable-auto-image-base=<var>value</var></code></dt>
  2560. <dd><p>Automatically choose the image base for DLLs, optionally starting with base
  2561. <var>value</var>, unless one is specified using the <code>--image-base</code> argument.
  2562. By using a hash generated from the dllname to create unique image bases
  2563. for each DLL, in-memory collisions and relocations which can delay program
  2564. execution are avoided.
  2565. [This option is specific to the i386 PE targeted port of the linker]
  2566. </p>
  2567. <a name="index-_002d_002ddisable_002dauto_002dimage_002dbase"></a>
  2568. </dd>
  2569. <dt><code>--disable-auto-image-base</code></dt>
  2570. <dd><p>Do not automatically generate a unique image base. If there is no
  2571. user-specified image base (<code>--image-base</code>) then use the platform
  2572. default.
  2573. [This option is specific to the i386 PE targeted port of the linker]
  2574. </p>
  2575. <a name="index-DLLs_002c-linking-to"></a>
  2576. <a name="index-_002d_002ddll_002dsearch_002dprefix"></a>
  2577. </dd>
  2578. <dt><code>--dll-search-prefix <var>string</var></code></dt>
  2579. <dd><p>When linking dynamically to a dll without an import library,
  2580. search for <code>&lt;string&gt;&lt;basename&gt;.dll</code> in preference to
  2581. <code>lib&lt;basename&gt;.dll</code>. This behaviour allows easy distinction
  2582. between DLLs built for the various &quot;subplatforms&quot;: native, cygwin,
  2583. uwin, pw, etc. For instance, cygwin DLLs typically use
  2584. <code>--dll-search-prefix=cyg</code>.
  2585. [This option is specific to the i386 PE targeted port of the linker]
  2586. </p>
  2587. <a name="index-_002d_002denable_002dauto_002dimport"></a>
  2588. </dd>
  2589. <dt><code>--enable-auto-import</code></dt>
  2590. <dd><p>Do sophisticated linking of <code>_symbol</code> to <code>__imp__symbol</code> for
  2591. DATA imports from DLLs, and create the necessary thunking symbols when
  2592. building the import libraries with those DATA exports. Note: Use of the
  2593. &rsquo;auto-import&rsquo; extension will cause the text section of the image file
  2594. to be made writable. This does not conform to the PE-COFF format
  2595. specification published by Microsoft.
  2596. </p>
  2597. <p>Note - use of the &rsquo;auto-import&rsquo; extension will also cause read only
  2598. data which would normally be placed into the .rdata section to be
  2599. placed into the .data section instead. This is in order to work
  2600. around a problem with consts that is described here:
  2601. http://www.cygwin.com/ml/cygwin/2004-09/msg01101.html
  2602. </p>
  2603. <p>Using &rsquo;auto-import&rsquo; generally will &rsquo;just work&rsquo; &ndash; but sometimes you may
  2604. see this message:
  2605. </p>
  2606. <p>&quot;variable &rsquo;&lt;var&gt;&rsquo; can&rsquo;t be auto-imported. Please read the
  2607. documentation for ld&rsquo;s <code>--enable-auto-import</code> for details.&quot;
  2608. </p>
  2609. <p>This message occurs when some (sub)expression accesses an address
  2610. ultimately given by the sum of two constants (Win32 import tables only
  2611. allow one). Instances where this may occur include accesses to member
  2612. fields of struct variables imported from a DLL, as well as using a
  2613. constant index into an array variable imported from a DLL. Any
  2614. multiword variable (arrays, structs, long long, etc) may trigger
  2615. this error condition. However, regardless of the exact data type
  2616. of the offending exported variable, ld will always detect it, issue
  2617. the warning, and exit.
  2618. </p>
  2619. <p>There are several ways to address this difficulty, regardless of the
  2620. data type of the exported variable:
  2621. </p>
  2622. <p>One way is to use &ndash;enable-runtime-pseudo-reloc switch. This leaves the task
  2623. of adjusting references in your client code for runtime environment, so
  2624. this method works only when runtime environment supports this feature.
  2625. </p>
  2626. <p>A second solution is to force one of the &rsquo;constants&rsquo; to be a variable &ndash;
  2627. that is, unknown and un-optimizable at compile time. For arrays,
  2628. there are two possibilities: a) make the indexee (the array&rsquo;s address)
  2629. a variable, or b) make the &rsquo;constant&rsquo; index a variable. Thus:
  2630. </p>
  2631. <div class="example">
  2632. <pre class="example">extern type extern_array[];
  2633. extern_array[1] --&gt;
  2634. { volatile type *t=extern_array; t[1] }
  2635. </pre></div>
  2636. <p>or
  2637. </p>
  2638. <div class="example">
  2639. <pre class="example">extern type extern_array[];
  2640. extern_array[1] --&gt;
  2641. { volatile int t=1; extern_array[t] }
  2642. </pre></div>
  2643. <p>For structs (and most other multiword data types) the only option
  2644. is to make the struct itself (or the long long, or the ...) variable:
  2645. </p>
  2646. <div class="example">
  2647. <pre class="example">extern struct s extern_struct;
  2648. extern_struct.field --&gt;
  2649. { volatile struct s *t=&amp;extern_struct; t-&gt;field }
  2650. </pre></div>
  2651. <p>or
  2652. </p>
  2653. <div class="example">
  2654. <pre class="example">extern long long extern_ll;
  2655. extern_ll --&gt;
  2656. { volatile long long * local_ll=&amp;extern_ll; *local_ll }
  2657. </pre></div>
  2658. <p>A third method of dealing with this difficulty is to abandon
  2659. &rsquo;auto-import&rsquo; for the offending symbol and mark it with
  2660. <code>__declspec(dllimport)</code>. However, in practice that
  2661. requires using compile-time #defines to indicate whether you are
  2662. building a DLL, building client code that will link to the DLL, or
  2663. merely building/linking to a static library. In making the choice
  2664. between the various methods of resolving the &rsquo;direct address with
  2665. constant offset&rsquo; problem, you should consider typical real-world usage:
  2666. </p>
  2667. <p>Original:
  2668. </p><div class="example">
  2669. <pre class="example">--foo.h
  2670. extern int arr[];
  2671. --foo.c
  2672. #include &quot;foo.h&quot;
  2673. void main(int argc, char **argv){
  2674. printf(&quot;%d\n&quot;,arr[1]);
  2675. }
  2676. </pre></div>
  2677. <p>Solution 1:
  2678. </p><div class="example">
  2679. <pre class="example">--foo.h
  2680. extern int arr[];
  2681. --foo.c
  2682. #include &quot;foo.h&quot;
  2683. void main(int argc, char **argv){
  2684. /* This workaround is for win32 and cygwin; do not &quot;optimize&quot; */
  2685. volatile int *parr = arr;
  2686. printf(&quot;%d\n&quot;,parr[1]);
  2687. }
  2688. </pre></div>
  2689. <p>Solution 2:
  2690. </p><div class="example">
  2691. <pre class="example">--foo.h
  2692. /* Note: auto-export is assumed (no __declspec(dllexport)) */
  2693. #if (defined(_WIN32) || defined(__CYGWIN__)) &amp;&amp; \
  2694. !(defined(FOO_BUILD_DLL) || defined(FOO_STATIC))
  2695. #define FOO_IMPORT __declspec(dllimport)
  2696. #else
  2697. #define FOO_IMPORT
  2698. #endif
  2699. extern FOO_IMPORT int arr[];
  2700. --foo.c
  2701. #include &quot;foo.h&quot;
  2702. void main(int argc, char **argv){
  2703. printf(&quot;%d\n&quot;,arr[1]);
  2704. }
  2705. </pre></div>
  2706. <p>A fourth way to avoid this problem is to re-code your
  2707. library to use a functional interface rather than a data interface
  2708. for the offending variables (e.g. set_foo() and get_foo() accessor
  2709. functions).
  2710. [This option is specific to the i386 PE targeted port of the linker]
  2711. </p>
  2712. <a name="index-_002d_002ddisable_002dauto_002dimport"></a>
  2713. </dd>
  2714. <dt><code>--disable-auto-import</code></dt>
  2715. <dd><p>Do not attempt to do sophisticated linking of <code>_symbol</code> to
  2716. <code>__imp__symbol</code> for DATA imports from DLLs.
  2717. [This option is specific to the i386 PE targeted port of the linker]
  2718. </p>
  2719. <a name="index-_002d_002denable_002druntime_002dpseudo_002dreloc"></a>
  2720. </dd>
  2721. <dt><code>--enable-runtime-pseudo-reloc</code></dt>
  2722. <dd><p>If your code contains expressions described in &ndash;enable-auto-import section,
  2723. that is, DATA imports from DLL with non-zero offset, this switch will create
  2724. a vector of &rsquo;runtime pseudo relocations&rsquo; which can be used by runtime
  2725. environment to adjust references to such data in your client code.
  2726. [This option is specific to the i386 PE targeted port of the linker]
  2727. </p>
  2728. <a name="index-_002d_002ddisable_002druntime_002dpseudo_002dreloc"></a>
  2729. </dd>
  2730. <dt><code>--disable-runtime-pseudo-reloc</code></dt>
  2731. <dd><p>Do not create pseudo relocations for non-zero offset DATA imports from
  2732. DLLs.
  2733. [This option is specific to the i386 PE targeted port of the linker]
  2734. </p>
  2735. <a name="index-_002d_002denable_002dextra_002dpe_002ddebug"></a>
  2736. </dd>
  2737. <dt><code>--enable-extra-pe-debug</code></dt>
  2738. <dd><p>Show additional debug info related to auto-import symbol thunking.
  2739. [This option is specific to the i386 PE targeted port of the linker]
  2740. </p>
  2741. <a name="index-_002d_002dsection_002dalignment"></a>
  2742. </dd>
  2743. <dt><code>--section-alignment</code></dt>
  2744. <dd><p>Sets the section alignment. Sections in memory will always begin at
  2745. addresses which are a multiple of this number. Defaults to 0x1000.
  2746. [This option is specific to the i386 PE targeted port of the linker]
  2747. </p>
  2748. <a name="index-stack-size"></a>
  2749. <a name="index-_002d_002dstack"></a>
  2750. </dd>
  2751. <dt><code>--stack <var>reserve</var></code></dt>
  2752. <dt><code>--stack <var>reserve</var>,<var>commit</var></code></dt>
  2753. <dd><p>Specify the number of bytes of memory to reserve (and optionally commit)
  2754. to be used as stack for this program. The default is 2MB reserved, 4K
  2755. committed.
  2756. [This option is specific to the i386 PE targeted port of the linker]
  2757. </p>
  2758. <a name="index-_002d_002dsubsystem"></a>
  2759. </dd>
  2760. <dt><code>--subsystem <var>which</var></code></dt>
  2761. <dt><code>--subsystem <var>which</var>:<var>major</var></code></dt>
  2762. <dt><code>--subsystem <var>which</var>:<var>major</var>.<var>minor</var></code></dt>
  2763. <dd><p>Specifies the subsystem under which your program will execute. The
  2764. legal values for <var>which</var> are <code>native</code>, <code>windows</code>,
  2765. <code>console</code>, <code>posix</code>, and <code>xbox</code>. You may optionally set
  2766. the subsystem version also. Numeric values are also accepted for
  2767. <var>which</var>.
  2768. [This option is specific to the i386 PE targeted port of the linker]
  2769. </p>
  2770. <p>The following options set flags in the <code>DllCharacteristics</code> field
  2771. of the PE file header:
  2772. [These options are specific to PE targeted ports of the linker]
  2773. </p>
  2774. <a name="index-_002d_002dhigh_002dentropy_002dva"></a>
  2775. </dd>
  2776. <dt><code>--high-entropy-va</code></dt>
  2777. <dd><p>Image is compatible with 64-bit address space layout randomization
  2778. (ASLR).
  2779. </p>
  2780. <a name="index-_002d_002ddynamicbase"></a>
  2781. </dd>
  2782. <dt><code>--dynamicbase</code></dt>
  2783. <dd><p>The image base address may be relocated using address space layout
  2784. randomization (ASLR). This feature was introduced with MS Windows
  2785. Vista for i386 PE targets.
  2786. </p>
  2787. <a name="index-_002d_002dforceinteg"></a>
  2788. </dd>
  2789. <dt><code>--forceinteg</code></dt>
  2790. <dd><p>Code integrity checks are enforced.
  2791. </p>
  2792. <a name="index-_002d_002dnxcompat"></a>
  2793. </dd>
  2794. <dt><code>--nxcompat</code></dt>
  2795. <dd><p>The image is compatible with the Data Execution Prevention.
  2796. This feature was introduced with MS Windows XP SP2 for i386 PE targets.
  2797. </p>
  2798. <a name="index-_002d_002dno_002disolation"></a>
  2799. </dd>
  2800. <dt><code>--no-isolation</code></dt>
  2801. <dd><p>Although the image understands isolation, do not isolate the image.
  2802. </p>
  2803. <a name="index-_002d_002dno_002dseh"></a>
  2804. </dd>
  2805. <dt><code>--no-seh</code></dt>
  2806. <dd><p>The image does not use SEH. No SE handler may be called from
  2807. this image.
  2808. </p>
  2809. <a name="index-_002d_002dno_002dbind"></a>
  2810. </dd>
  2811. <dt><code>--no-bind</code></dt>
  2812. <dd><p>Do not bind this image.
  2813. </p>
  2814. <a name="index-_002d_002dwdmdriver"></a>
  2815. </dd>
  2816. <dt><code>--wdmdriver</code></dt>
  2817. <dd><p>The driver uses the MS Windows Driver Model.
  2818. </p>
  2819. <a name="index-_002d_002dtsaware"></a>
  2820. </dd>
  2821. <dt><code>--tsaware</code></dt>
  2822. <dd><p>The image is Terminal Server aware.
  2823. </p>
  2824. <a name="index-_002d_002dinsert_002dtimestamp"></a>
  2825. </dd>
  2826. <dt><code>--insert-timestamp</code></dt>
  2827. <dt><code>--no-insert-timestamp</code></dt>
  2828. <dd><p>Insert a real timestamp into the image. This is the default behaviour
  2829. as it matches legacy code and it means that the image will work with
  2830. other, proprietary tools. The problem with this default is that it
  2831. will result in slightly different images being produced each time the
  2832. same sources are linked. The option <samp>--no-insert-timestamp</samp>
  2833. can be used to insert a zero value for the timestamp, this ensuring
  2834. that binaries produced from identical sources will compare
  2835. identically.
  2836. </p></dd>
  2837. </dl>
  2838. <a name="Options-specific-to-C6X-uClinux-targets"></a>
  2839. <h4 class="subsection">2.1.2 Options specific to C6X uClinux targets</h4>
  2840. <p>The C6X uClinux target uses a binary format called DSBT to support shared
  2841. libraries. Each shared library in the system needs to have a unique index;
  2842. all executables use an index of 0.
  2843. </p>
  2844. <dl compact="compact">
  2845. <dd>
  2846. <a name="index-_002d_002ddsbt_002dsize"></a>
  2847. </dd>
  2848. <dt><code>--dsbt-size <var>size</var></code></dt>
  2849. <dd><p>This option sets the number of entries in the DSBT of the current executable
  2850. or shared library to <var>size</var>. The default is to create a table with 64
  2851. entries.
  2852. </p>
  2853. <a name="index-_002d_002ddsbt_002dindex"></a>
  2854. </dd>
  2855. <dt><code>--dsbt-index <var>index</var></code></dt>
  2856. <dd><p>This option sets the DSBT index of the current executable or shared library
  2857. to <var>index</var>. The default is 0, which is appropriate for generating
  2858. executables. If a shared library is generated with a DSBT index of 0, the
  2859. <code>R_C6000_DSBT_INDEX</code> relocs are copied into the output file.
  2860. </p>
  2861. <a name="index-_002d_002dno_002dmerge_002dexidx_002dentries"></a>
  2862. <p>The &lsquo;<samp>--no-merge-exidx-entries</samp>&rsquo; switch disables the merging of adjacent
  2863. exidx entries in frame unwind info.
  2864. </p>
  2865. </dd>
  2866. </dl>
  2867. <a name="Options-specific-to-Motorola-68HC11-and-68HC12-targets"></a>
  2868. <h4 class="subsection">2.1.3 Options specific to Motorola 68HC11 and 68HC12 targets</h4>
  2869. <p>The 68HC11 and 68HC12 linkers support specific options to control the
  2870. memory bank switching mapping and trampoline code generation.
  2871. </p>
  2872. <dl compact="compact">
  2873. <dd>
  2874. <a name="index-_002d_002dno_002dtrampoline"></a>
  2875. </dd>
  2876. <dt><code>--no-trampoline</code></dt>
  2877. <dd><p>This option disables the generation of trampoline. By default a trampoline
  2878. is generated for each far function which is called using a <code>jsr</code>
  2879. instruction (this happens when a pointer to a far function is taken).
  2880. </p>
  2881. <a name="index-_002d_002dbank_002dwindow"></a>
  2882. </dd>
  2883. <dt><code>--bank-window <var>name</var></code></dt>
  2884. <dd><p>This option indicates to the linker the name of the memory region in
  2885. the &lsquo;<samp>MEMORY</samp>&rsquo; specification that describes the memory bank window.
  2886. The definition of such region is then used by the linker to compute
  2887. paging and addresses within the memory window.
  2888. </p>
  2889. </dd>
  2890. </dl>
  2891. <a name="Options-specific-to-Motorola-68K-target"></a>
  2892. <h4 class="subsection">2.1.4 Options specific to Motorola 68K target</h4>
  2893. <p>The following options are supported to control handling of GOT generation
  2894. when linking for 68K targets.
  2895. </p>
  2896. <dl compact="compact">
  2897. <dd>
  2898. <a name="index-_002d_002dgot"></a>
  2899. </dd>
  2900. <dt><code>--got=<var>type</var></code></dt>
  2901. <dd><p>This option tells the linker which GOT generation scheme to use.
  2902. <var>type</var> should be one of &lsquo;<samp>single</samp>&rsquo;, &lsquo;<samp>negative</samp>&rsquo;,
  2903. &lsquo;<samp>multigot</samp>&rsquo; or &lsquo;<samp>target</samp>&rsquo;. For more information refer to the
  2904. Info entry for <samp>ld</samp>.
  2905. </p>
  2906. </dd>
  2907. </dl>
  2908. <a name="Options-specific-to-MIPS-targets"></a>
  2909. <h4 class="subsection">2.1.5 Options specific to MIPS targets</h4>
  2910. <p>The following options are supported to control microMIPS instruction
  2911. generation and branch relocation checks for ISA mode transitions when
  2912. linking for MIPS targets.
  2913. </p>
  2914. <dl compact="compact">
  2915. <dd>
  2916. <a name="index-_002d_002dinsn32"></a>
  2917. </dd>
  2918. <dt><code>--insn32</code></dt>
  2919. <dd><a name="index-_002d_002dno_002dinsn32"></a>
  2920. </dd>
  2921. <dt><code>--no-insn32</code></dt>
  2922. <dd><p>These options control the choice of microMIPS instructions used in code
  2923. generated by the linker, such as that in the PLT or lazy binding stubs,
  2924. or in relaxation. If &lsquo;<samp>--insn32</samp>&rsquo; is used, then the linker only uses
  2925. 32-bit instruction encodings. By default or if &lsquo;<samp>--no-insn32</samp>&rsquo; is
  2926. used, all instruction encodings are used, including 16-bit ones where
  2927. possible.
  2928. </p>
  2929. <a name="index-_002d_002dignore_002dbranch_002disa"></a>
  2930. </dd>
  2931. <dt><code>--ignore-branch-isa</code></dt>
  2932. <dd><a name="index-_002d_002dno_002dignore_002dbranch_002disa"></a>
  2933. </dd>
  2934. <dt><code>--no-ignore-branch-isa</code></dt>
  2935. <dd><p>These options control branch relocation checks for invalid ISA mode
  2936. transitions. If &lsquo;<samp>--ignore-branch-isa</samp>&rsquo; is used, then the linker
  2937. accepts any branch relocations and any ISA mode transition required
  2938. is lost in relocation calculation, except for some cases of <code>BAL</code>
  2939. instructions which meet relaxation conditions and are converted to
  2940. equivalent <code>JALX</code> instructions as the associated relocation is
  2941. calculated. By default or if &lsquo;<samp>--no-ignore-branch-isa</samp>&rsquo; is used
  2942. a check is made causing the loss of an ISA mode transition to produce
  2943. an error.
  2944. </p>
  2945. </dd>
  2946. </dl>
  2947. <hr>
  2948. <div class="header">
  2949. <p>
  2950. Next: <a href="Environment.html#Environment" accesskey="n" rel="next">Environment</a>, Up: <a href="Invocation.html#Invocation" accesskey="u" rel="up">Invocation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LD-Index.html#LD-Index" title="Index" rel="index">Index</a>]</p>
  2951. </div>
  2952. </body>
  2953. </html>