Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

3 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1991-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3
  6. or any later version published by the Free Software Foundation;
  7. with no Invariant Sections, with no Front-Cover Texts, and with no
  8. Back-Cover Texts. A copy of the license is included in the
  9. section entitled "GNU Free Documentation License".
  10. -->
  11. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  14. <title>def file format (GNU Binary Utilities)</title>
  15. <meta name="description" content="def file format (GNU Binary Utilities)">
  16. <meta name="keywords" content="def file format (GNU Binary Utilities)">
  17. <meta name="resource-type" content="document">
  18. <meta name="distribution" content="global">
  19. <meta name="Generator" content="makeinfo">
  20. <link href="index.html#Top" rel="start" title="Top">
  21. <link href="Binutils-Index.html#Binutils-Index" rel="index" title="Binutils Index">
  22. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  23. <link href="dlltool.html#dlltool" rel="up" title="dlltool">
  24. <link href="readelf.html#readelf" rel="next" title="readelf">
  25. <link href="dlltool.html#dlltool" rel="prev" title="dlltool">
  26. <style type="text/css">
  27. <!--
  28. a.summary-letter {text-decoration: none}
  29. blockquote.indentedblock {margin-right: 0em}
  30. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.lisp {margin-left: 3.2em}
  35. div.smalldisplay {margin-left: 3.2em}
  36. div.smallexample {margin-left: 3.2em}
  37. div.smalllisp {margin-left: 3.2em}
  38. kbd {font-style: oblique}
  39. pre.display {font-family: inherit}
  40. pre.format {font-family: inherit}
  41. pre.menu-comment {font-family: serif}
  42. pre.menu-preformatted {font-family: serif}
  43. pre.smalldisplay {font-family: inherit; font-size: smaller}
  44. pre.smallexample {font-size: smaller}
  45. pre.smallformat {font-family: inherit; font-size: smaller}
  46. pre.smalllisp {font-size: smaller}
  47. span.nolinebreak {white-space: nowrap}
  48. span.roman {font-family: initial; font-weight: normal}
  49. span.sansserif {font-family: sans-serif; font-weight: normal}
  50. ul.no-bullet {list-style: none}
  51. -->
  52. </style>
  53. </head>
  54. <body lang="en">
  55. <a name="def-file-format"></a>
  56. <div class="header">
  57. <p>
  58. Up: <a href="dlltool.html#dlltool" accesskey="u" rel="up">dlltool</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Binutils-Index.html#Binutils-Index" title="Index" rel="index">Index</a>]</p>
  59. </div>
  60. <hr>
  61. <a name="The-format-of-the-dlltool-_002edef-file"></a>
  62. <h3 class="section">13.1 The format of the <code>dlltool</code> <samp>.def</samp> file</h3>
  63. <p>A <samp>.def</samp> file contains any number of the following commands:
  64. </p>
  65. <dl compact="compact">
  66. <dt><code>NAME</code> <var>name</var> <code>[ ,</code> <var>base</var> <code>]</code></dt>
  67. <dd><p>The result is going to be named <var>name</var><code>.exe</code>.
  68. </p>
  69. </dd>
  70. <dt><code>LIBRARY</code> <var>name</var> <code>[ ,</code> <var>base</var> <code>]</code></dt>
  71. <dd><p>The result is going to be named <var>name</var><code>.dll</code>.
  72. Note: If you want to use LIBRARY as name then you need to quote. Otherwise
  73. this will fail due a necessary hack for libtool (see PR binutils/13710 for more
  74. details).
  75. </p>
  76. </dd>
  77. <dt><code>EXPORTS ( ( (</code> <var>name1</var> <code>[ = </code> <var>name2</var> <code>] ) | ( </code> <var>name1</var> <code>=</code> <var>module-name</var> <code>.</code> <var>external-name</var> <code>) ) [ == </code> <var>its_name</var> <code>]</code></dt>
  78. <dt><code>[</code> <var>integer</var> <code>] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *</code></dt>
  79. <dd><p>Declares <var>name1</var> as an exported symbol from the DLL, with optional
  80. ordinal number <var>integer</var>, or declares <var>name1</var> as an alias
  81. (forward) of the function <var>external-name</var> in the DLL.
  82. If <var>its_name</var> is specified, this name is used as string in export table.
  83. <var>module-name</var>.
  84. Note: The <code>EXPORTS</code> has to be the last command in .def file, as keywords
  85. are treated - beside <code>LIBRARY</code> - as simple name-identifiers.
  86. If you want to use LIBRARY as name then you need to quote it.
  87. </p>
  88. </dd>
  89. <dt><code>IMPORTS ( (</code> <var>internal-name</var> <code>=</code> <var>module-name</var> <code>.</code> <var>integer</var> <code>) | [</code> <var>internal-name</var> <code>= ]</code> <var>module-name</var> <code>.</code> <var>external-name</var> <code>) [ == ) <var>its_name</var> <code>]</code> *</code></dt>
  90. <dd><p>Declares that <var>external-name</var> or the exported function whose
  91. ordinal number is <var>integer</var> is to be imported from the file
  92. <var>module-name</var>. If <var>internal-name</var> is specified then this is
  93. the name that the imported function will be referred to in the body of
  94. the DLL.
  95. If <var>its_name</var> is specified, this name is used as string in import table.
  96. Note: The <code>IMPORTS</code> has to be the last command in .def file, as keywords
  97. are treated - beside <code>LIBRARY</code> - as simple name-identifiers.
  98. If you want to use LIBRARY as name then you need to quote it.
  99. </p>
  100. </dd>
  101. <dt><code>DESCRIPTION</code> <var>string</var></dt>
  102. <dd><p>Puts <var>string</var> into the output <samp>.exp</samp> file in the
  103. <code>.rdata</code> section.
  104. </p>
  105. </dd>
  106. <dt><code>STACKSIZE</code> <var>number-reserve</var> <code>[, </code> <var>number-commit</var> <code>]</code></dt>
  107. <dt><code>HEAPSIZE</code> <var>number-reserve</var> <code>[, </code> <var>number-commit</var> <code>]</code></dt>
  108. <dd><p>Generates <code>--stack</code> or <code>--heap</code>
  109. <var>number-reserve</var>,<var>number-commit</var> in the output <code>.drectve</code>
  110. section. The linker will see this and act upon it.
  111. </p>
  112. </dd>
  113. <dt><code>CODE</code> <var>attr</var> <code>+</code></dt>
  114. <dt><code>DATA</code> <var>attr</var> <code>+</code></dt>
  115. <dt><code>SECTIONS (</code> <var>section-name</var> <var>attr</var><code> + ) *</code></dt>
  116. <dd><p>Generates <code>--attr</code> <var>section-name</var> <var>attr</var> in the output
  117. <code>.drectve</code> section, where <var>attr</var> is one of <code>READ</code>,
  118. <code>WRITE</code>, <code>EXECUTE</code> or <code>SHARED</code>. The linker will see
  119. this and act upon it.
  120. </p>
  121. </dd>
  122. </dl>
  123. <hr>
  124. <div class="header">
  125. <p>
  126. Up: <a href="dlltool.html#dlltool" accesskey="u" rel="up">dlltool</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Binutils-Index.html#Binutils-Index" title="Index" rel="index">Index</a>]</p>
  127. </div>
  128. </body>
  129. </html>