您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

symbol-handling-functions.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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 BFD library.
  4. Copyright (C) 1991-2020 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3 or
  7. any later version published by the Free Software Foundation; with the
  8. Invariant Sections being "GNU General Public License" and "Funding
  9. Free Software", the Front-Cover texts being (a) (see below), and with
  10. the Back-Cover Texts being (b) (see below). A copy of the license is
  11. included in the section entitled "GNU Free Documentation License".
  12. (a) The FSF's Front-Cover Text is:
  13. A GNU Manual
  14. (b) The FSF's Back-Cover Text is:
  15. You have freedom to copy and modify this GNU Manual, like GNU
  16. software. Copies published by the Free Software Foundation raise
  17. funds for GNU development. -->
  18. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  19. <head>
  20. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  21. <title>symbol handling functions (Untitled Document)</title>
  22. <meta name="description" content="symbol handling functions (Untitled Document)">
  23. <meta name="keywords" content="symbol handling functions (Untitled Document)">
  24. <meta name="resource-type" content="document">
  25. <meta name="distribution" content="global">
  26. <meta name="Generator" content="makeinfo">
  27. <link href="index.html#Top" rel="start" title="Top">
  28. <link href="BFD-Index.html#BFD-Index" rel="index" title="BFD Index">
  29. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  30. <link href="Symbols.html#Symbols" rel="up" title="Symbols">
  31. <link href="Archives.html#Archives" rel="next" title="Archives">
  32. <link href="typedef-asymbol.html#typedef-asymbol" rel="prev" title="typedef asymbol">
  33. <style type="text/css">
  34. <!--
  35. a.summary-letter {text-decoration: none}
  36. blockquote.indentedblock {margin-right: 0em}
  37. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  38. blockquote.smallquotation {font-size: smaller}
  39. div.display {margin-left: 3.2em}
  40. div.example {margin-left: 3.2em}
  41. div.lisp {margin-left: 3.2em}
  42. div.smalldisplay {margin-left: 3.2em}
  43. div.smallexample {margin-left: 3.2em}
  44. div.smalllisp {margin-left: 3.2em}
  45. kbd {font-style: oblique}
  46. pre.display {font-family: inherit}
  47. pre.format {font-family: inherit}
  48. pre.menu-comment {font-family: serif}
  49. pre.menu-preformatted {font-family: serif}
  50. pre.smalldisplay {font-family: inherit; font-size: smaller}
  51. pre.smallexample {font-size: smaller}
  52. pre.smallformat {font-family: inherit; font-size: smaller}
  53. pre.smalllisp {font-size: smaller}
  54. span.nolinebreak {white-space: nowrap}
  55. span.roman {font-family: initial; font-weight: normal}
  56. span.sansserif {font-family: sans-serif; font-weight: normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en">
  62. <a name="symbol-handling-functions"></a>
  63. <div class="header">
  64. <p>
  65. Previous: <a href="typedef-asymbol.html#typedef-asymbol" accesskey="p" rel="prev">typedef asymbol</a>, Up: <a href="Symbols.html#Symbols" accesskey="u" rel="up">Symbols</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="BFD-Index.html#BFD-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="Symbol-handling-functions"></a>
  69. <h4 class="subsection">2.7.5 Symbol handling functions</h4>
  70. <a name="index-bfd_005fget_005fsymtab_005fupper_005fbound"></a>
  71. <a name="bfd_005fget_005fsymtab_005fupper_005fbound"></a>
  72. <h4 class="subsubsection">2.7.5.1 <code>bfd_get_symtab_upper_bound</code></h4>
  73. <p><strong>Description</strong><br>
  74. Return the number of bytes required to store a vector of pointers
  75. to <code>asymbols</code> for all the symbols in the BFD <var>abfd</var>,
  76. including a terminal NULL pointer. If there are no symbols in
  77. the BFD, then return 0. If an error occurs, return -1.
  78. </p><div class="example">
  79. <pre class="example">#define bfd_get_symtab_upper_bound(abfd) \
  80. BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
  81. </pre></div>
  82. <a name="index-bfd_005fis_005flocal_005flabel"></a>
  83. <a name="bfd_005fis_005flocal_005flabel"></a>
  84. <h4 class="subsubsection">2.7.5.2 <code>bfd_is_local_label</code></h4>
  85. <p><strong>Synopsis</strong>
  86. </p><div class="example">
  87. <pre class="example">bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
  88. </pre></div>
  89. <p><strong>Description</strong><br>
  90. Return TRUE if the given symbol <var>sym</var> in the BFD <var>abfd</var> is
  91. a compiler generated local label, else return FALSE.
  92. </p>
  93. <a name="index-bfd_005fis_005flocal_005flabel_005fname"></a>
  94. <a name="bfd_005fis_005flocal_005flabel_005fname"></a>
  95. <h4 class="subsubsection">2.7.5.3 <code>bfd_is_local_label_name</code></h4>
  96. <p><strong>Synopsis</strong>
  97. </p><div class="example">
  98. <pre class="example">bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
  99. </pre></div>
  100. <p><strong>Description</strong><br>
  101. Return TRUE if a symbol with the name <var>name</var> in the BFD
  102. <var>abfd</var> is a compiler generated local label, else return
  103. FALSE. This just checks whether the name has the form of a
  104. local label.
  105. </p><div class="example">
  106. <pre class="example">#define bfd_is_local_label_name(abfd, name) \
  107. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
  108. </pre></div>
  109. <a name="index-bfd_005fis_005ftarget_005fspecial_005fsymbol"></a>
  110. <a name="bfd_005fis_005ftarget_005fspecial_005fsymbol"></a>
  111. <h4 class="subsubsection">2.7.5.4 <code>bfd_is_target_special_symbol</code></h4>
  112. <p><strong>Synopsis</strong>
  113. </p><div class="example">
  114. <pre class="example">bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
  115. </pre></div>
  116. <p><strong>Description</strong><br>
  117. Return TRUE iff a symbol <var>sym</var> in the BFD <var>abfd</var> is something
  118. special to the particular target represented by the BFD. Such symbols
  119. should normally not be mentioned to the user.
  120. </p><div class="example">
  121. <pre class="example">#define bfd_is_target_special_symbol(abfd, sym) \
  122. BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
  123. </pre></div>
  124. <a name="index-bfd_005fcanonicalize_005fsymtab"></a>
  125. <a name="bfd_005fcanonicalize_005fsymtab"></a>
  126. <h4 class="subsubsection">2.7.5.5 <code>bfd_canonicalize_symtab</code></h4>
  127. <p><strong>Description</strong><br>
  128. Read the symbols from the BFD <var>abfd</var>, and fills in
  129. the vector <var>location</var> with pointers to the symbols and
  130. a trailing NULL.
  131. Return the actual number of symbol pointers, not
  132. including the NULL.
  133. </p><div class="example">
  134. <pre class="example">#define bfd_canonicalize_symtab(abfd, location) \
  135. BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
  136. </pre></div>
  137. <a name="index-bfd_005fset_005fsymtab"></a>
  138. <a name="bfd_005fset_005fsymtab"></a>
  139. <h4 class="subsubsection">2.7.5.6 <code>bfd_set_symtab</code></h4>
  140. <p><strong>Synopsis</strong>
  141. </p><div class="example">
  142. <pre class="example">bfd_boolean bfd_set_symtab
  143. (bfd *abfd, asymbol **location, unsigned int count);
  144. </pre></div>
  145. <p><strong>Description</strong><br>
  146. Arrange that when the output BFD <var>abfd</var> is closed,
  147. the table <var>location</var> of <var>count</var> pointers to symbols
  148. will be written.
  149. </p>
  150. <a name="index-bfd_005fprint_005fsymbol_005fvandf"></a>
  151. <a name="bfd_005fprint_005fsymbol_005fvandf"></a>
  152. <h4 class="subsubsection">2.7.5.7 <code>bfd_print_symbol_vandf</code></h4>
  153. <p><strong>Synopsis</strong>
  154. </p><div class="example">
  155. <pre class="example">void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
  156. </pre></div>
  157. <p><strong>Description</strong><br>
  158. Print the value and flags of the <var>symbol</var> supplied to the
  159. stream <var>file</var>.
  160. </p>
  161. <a name="index-bfd_005fmake_005fempty_005fsymbol"></a>
  162. <a name="bfd_005fmake_005fempty_005fsymbol"></a>
  163. <h4 class="subsubsection">2.7.5.8 <code>bfd_make_empty_symbol</code></h4>
  164. <p><strong>Description</strong><br>
  165. Create a new <code>asymbol</code> structure for the BFD <var>abfd</var>
  166. and return a pointer to it.
  167. </p>
  168. <p>This routine is necessary because each back end has private
  169. information surrounding the <code>asymbol</code>. Building your own
  170. <code>asymbol</code> and pointing to it will not create the private
  171. information, and will cause problems later on.
  172. </p><div class="example">
  173. <pre class="example">#define bfd_make_empty_symbol(abfd) \
  174. BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
  175. </pre></div>
  176. <a name="index-_005fbfd_005fgeneric_005fmake_005fempty_005fsymbol"></a>
  177. <a name="g_t_005fbfd_005fgeneric_005fmake_005fempty_005fsymbol"></a>
  178. <h4 class="subsubsection">2.7.5.9 <code>_bfd_generic_make_empty_symbol</code></h4>
  179. <p><strong>Synopsis</strong>
  180. </p><div class="example">
  181. <pre class="example">asymbol *_bfd_generic_make_empty_symbol (bfd *);
  182. </pre></div>
  183. <p><strong>Description</strong><br>
  184. Create a new <code>asymbol</code> structure for the BFD <var>abfd</var>
  185. and return a pointer to it. Used by core file routines,
  186. binary back-end and anywhere else where no private info
  187. is needed.
  188. </p>
  189. <a name="index-bfd_005fmake_005fdebug_005fsymbol"></a>
  190. <a name="bfd_005fmake_005fdebug_005fsymbol"></a>
  191. <h4 class="subsubsection">2.7.5.10 <code>bfd_make_debug_symbol</code></h4>
  192. <p><strong>Description</strong><br>
  193. Create a new <code>asymbol</code> structure for the BFD <var>abfd</var>,
  194. to be used as a debugging symbol. Further details of its use have
  195. yet to be worked out.
  196. </p><div class="example">
  197. <pre class="example">#define bfd_make_debug_symbol(abfd,ptr,size) \
  198. BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
  199. </pre></div>
  200. <a name="index-bfd_005fdecode_005fsymclass"></a>
  201. <a name="bfd_005fdecode_005fsymclass"></a>
  202. <h4 class="subsubsection">2.7.5.11 <code>bfd_decode_symclass</code></h4>
  203. <p><strong>Description</strong><br>
  204. Return a character corresponding to the symbol
  205. class of <var>symbol</var>, or &rsquo;?&rsquo; for an unknown class.
  206. </p>
  207. <p><strong>Synopsis</strong>
  208. </p><div class="example">
  209. <pre class="example">int bfd_decode_symclass (asymbol *symbol);
  210. </pre></div>
  211. <a name="index-bfd_005fis_005fundefined_005fsymclass"></a>
  212. <a name="bfd_005fis_005fundefined_005fsymclass"></a>
  213. <h4 class="subsubsection">2.7.5.12 <code>bfd_is_undefined_symclass</code></h4>
  214. <p><strong>Description</strong><br>
  215. Returns non-zero if the class symbol returned by
  216. bfd_decode_symclass represents an undefined symbol.
  217. Returns zero otherwise.
  218. </p>
  219. <p><strong>Synopsis</strong>
  220. </p><div class="example">
  221. <pre class="example">bfd_boolean bfd_is_undefined_symclass (int symclass);
  222. </pre></div>
  223. <a name="index-bfd_005fsymbol_005finfo"></a>
  224. <a name="bfd_005fsymbol_005finfo"></a>
  225. <h4 class="subsubsection">2.7.5.13 <code>bfd_symbol_info</code></h4>
  226. <p><strong>Description</strong><br>
  227. Fill in the basic info about symbol that nm needs.
  228. Additional info may be added by the back-ends after
  229. calling this function.
  230. </p>
  231. <p><strong>Synopsis</strong>
  232. </p><div class="example">
  233. <pre class="example">void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
  234. </pre></div>
  235. <a name="index-bfd_005fcopy_005fprivate_005fsymbol_005fdata"></a>
  236. <a name="bfd_005fcopy_005fprivate_005fsymbol_005fdata"></a>
  237. <h4 class="subsubsection">2.7.5.14 <code>bfd_copy_private_symbol_data</code></h4>
  238. <p><strong>Synopsis</strong>
  239. </p><div class="example">
  240. <pre class="example">bfd_boolean bfd_copy_private_symbol_data
  241. (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
  242. </pre></div>
  243. <p><strong>Description</strong><br>
  244. Copy private symbol information from <var>isym</var> in the BFD
  245. <var>ibfd</var> to the symbol <var>osym</var> in the BFD <var>obfd</var>.
  246. Return <code>TRUE</code> on success, <code>FALSE</code> on error. Possible error
  247. returns are:
  248. </p>
  249. <ul>
  250. <li> <code>bfd_error_no_memory</code> -
  251. Not enough memory exists to create private data for <var>osec</var>.
  252. </li></ul>
  253. <div class="example">
  254. <pre class="example">#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
  255. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
  256. (ibfd, isymbol, obfd, osymbol))
  257. </pre></div>
  258. <hr>
  259. <div class="header">
  260. <p>
  261. Previous: <a href="typedef-asymbol.html#typedef-asymbol" accesskey="p" rel="prev">typedef asymbol</a>, Up: <a href="Symbols.html#Symbols" accesskey="u" rel="up">Symbols</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="BFD-Index.html#BFD-Index" title="Index" rel="index">Index</a>]</p>
  262. </div>
  263. </body>
  264. </html>