You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Environment.html 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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 Arm Embedded Toolchain 10-2020-q4-major)
  5. version 2.35.1.
  6. Copyright (C) 1991-2020 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 6.5, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title>Environment (LD)</title>
  17. <meta name="description" content="Environment (LD)">
  18. <meta name="keywords" content="Environment (LD)">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  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="Scripts.html#Scripts" rel="next" title="Scripts">
  27. <link href="Options.html#Options" rel="prev" title="Options">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.indentedblock {margin-right: 0em}
  32. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  33. blockquote.smallquotation {font-size: smaller}
  34. div.display {margin-left: 3.2em}
  35. div.example {margin-left: 3.2em}
  36. div.lisp {margin-left: 3.2em}
  37. div.smalldisplay {margin-left: 3.2em}
  38. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  50. span.roman {font-family: initial; font-weight: normal}
  51. span.sansserif {font-family: sans-serif; font-weight: normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en">
  57. <a name="Environment"></a>
  58. <div class="header">
  59. <p>
  60. Previous: <a href="Options.html#Options" accesskey="p" rel="prev">Options</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>
  61. </div>
  62. <hr>
  63. <a name="Environment-Variables"></a>
  64. <h3 class="section">2.2 Environment Variables</h3>
  65. <p>You can change the behaviour of <code>ld</code> with the environment variables
  66. <code>GNUTARGET</code>,
  67. <code>LDEMULATION</code> and <code>COLLECT_NO_DEMANGLE</code>.
  68. </p>
  69. <a name="index-GNUTARGET"></a>
  70. <a name="index-default-input-format"></a>
  71. <p><code>GNUTARGET</code> determines the input-file object format if you don&rsquo;t
  72. use &lsquo;<samp>-b</samp>&rsquo; (or its synonym &lsquo;<samp>--format</samp>&rsquo;). Its value should be one
  73. of the BFD names for an input format (see <a href="BFD.html#BFD">BFD</a>). If there is no
  74. <code>GNUTARGET</code> in the environment, <code>ld</code> uses the natural format
  75. of the target. If <code>GNUTARGET</code> is set to <code>default</code> then BFD
  76. attempts to discover the input format by examining binary input files;
  77. this method often succeeds, but there are potential ambiguities, since
  78. there is no method of ensuring that the magic number used to specify
  79. object-file formats is unique. However, the configuration procedure for
  80. BFD on each system places the conventional format for that system first
  81. in the search-list, so ambiguities are resolved in favor of convention.
  82. </p>
  83. <a name="index-LDEMULATION"></a>
  84. <a name="index-default-emulation"></a>
  85. <a name="index-emulation_002c-default"></a>
  86. <p><code>LDEMULATION</code> determines the default emulation if you don&rsquo;t use the
  87. &lsquo;<samp>-m</samp>&rsquo; option. The emulation can affect various aspects of linker
  88. behaviour, particularly the default linker script. You can list the
  89. available emulations with the &lsquo;<samp>--verbose</samp>&rsquo; or &lsquo;<samp>-V</samp>&rsquo; options. If
  90. the &lsquo;<samp>-m</samp>&rsquo; option is not used, and the <code>LDEMULATION</code> environment
  91. variable is not defined, the default emulation depends upon how the
  92. linker was configured.
  93. </p>
  94. <a name="index-COLLECT_005fNO_005fDEMANGLE"></a>
  95. <a name="index-demangling_002c-default"></a>
  96. <p>Normally, the linker will default to demangling symbols. However, if
  97. <code>COLLECT_NO_DEMANGLE</code> is set in the environment, then it will
  98. default to not demangling symbols. This environment variable is used in
  99. a similar fashion by the <code>gcc</code> linker wrapper program. The default
  100. may be overridden by the &lsquo;<samp>--demangle</samp>&rsquo; and &lsquo;<samp>--no-demangle</samp>&rsquo;
  101. options.
  102. </p>
  103. <hr>
  104. <div class="header">
  105. <p>
  106. Previous: <a href="Options.html#Options" accesskey="p" rel="prev">Options</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>
  107. </div>
  108. </body>
  109. </html>