symbol-handling-functions.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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-2017 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 5.2, http://www.gnu.org/software/texinfo/ -->
  19. <head>
  20. <title>Untitled Document: symbol handling functions</title>
  21. <meta name="description" content="Untitled Document: symbol handling functions">
  22. <meta name="keywords" content="Untitled Document: symbol handling functions">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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.smallquotation {font-size: smaller}
  37. div.display {margin-left: 3.2em}
  38. div.example {margin-left: 3.2em}
  39. div.indentedblock {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  55. span.nolinebreak {white-space:nowrap}
  56. span.roman {font-family:serif; font-weight:normal}
  57. span.sansserif {font-family:sans-serif; font-weight:normal}
  58. ul.no-bullet {list-style: none}
  59. -->
  60. </style>
  61. </head>
  62. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  63. <a name="symbol-handling-functions"></a>
  64. <div class="header">
  65. <p>
  66. 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>
  67. </div>
  68. <hr>
  69. <a name="Symbol-handling-functions"></a>
  70. <h4 class="subsection">2.7.5 Symbol handling functions</h4>
  71. <a name="index-bfd_005fget_005fsymtab_005fupper_005fbound"></a>
  72. <a name="bfd_005fget_005fsymtab_005fupper_005fbound"></a>
  73. <h4 class="subsubsection">2.7.5.1 <code>bfd_get_symtab_upper_bound</code></h4>
  74. <p><strong>Description</strong><br>
  75. Return the number of bytes required to store a vector of pointers
  76. to <code>asymbols</code> for all the symbols in the BFD <var>abfd</var>,
  77. including a terminal NULL pointer. If there are no symbols in
  78. the BFD, then return 0. If an error occurs, return -1.
  79. </p><div class="example">
  80. <pre class="example">#define bfd_get_symtab_upper_bound(abfd) \
  81. BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
  82. </pre></div>
  83. <a name="index-bfd_005fis_005flocal_005flabel"></a>
  84. <a name="bfd_005fis_005flocal_005flabel"></a>
  85. <h4 class="subsubsection">2.7.5.2 <code>bfd_is_local_label</code></h4>
  86. <p><strong>Synopsis</strong>
  87. </p><div class="example">
  88. <pre class="example">bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
  89. </pre></div>
  90. <p><strong>Description</strong><br>
  91. Return TRUE if the given symbol <var>sym</var> in the BFD <var>abfd</var> is
  92. a compiler generated local label, else return FALSE.
  93. </p>
  94. <a name="index-bfd_005fis_005flocal_005flabel_005fname"></a>
  95. <a name="bfd_005fis_005flocal_005flabel_005fname"></a>
  96. <h4 class="subsubsection">2.7.5.3 <code>bfd_is_local_label_name</code></h4>
  97. <p><strong>Synopsis</strong>
  98. </p><div class="example">
  99. <pre class="example">bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
  100. </pre></div>
  101. <p><strong>Description</strong><br>
  102. Return TRUE if a symbol with the name <var>name</var> in the BFD
  103. <var>abfd</var> is a compiler generated local label, else return
  104. FALSE. This just checks whether the name has the form of a
  105. local label.
  106. </p><div class="example">
  107. <pre class="example">#define bfd_is_local_label_name(abfd, name) \
  108. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
  109. </pre></div>
  110. <a name="index-bfd_005fis_005ftarget_005fspecial_005fsymbol"></a>
  111. <a name="bfd_005fis_005ftarget_005fspecial_005fsymbol"></a>
  112. <h4 class="subsubsection">2.7.5.4 <code>bfd_is_target_special_symbol</code></h4>
  113. <p><strong>Synopsis</strong>
  114. </p><div class="example">
  115. <pre class="example">bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
  116. </pre></div>
  117. <p><strong>Description</strong><br>
  118. Return TRUE iff a symbol <var>sym</var> in the BFD <var>abfd</var> is something
  119. special to the particular target represented by the BFD. Such symbols
  120. should normally not be mentioned to the user.
  121. </p><div class="example">
  122. <pre class="example">#define bfd_is_target_special_symbol(abfd, sym) \
  123. BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
  124. </pre></div>
  125. <a name="index-bfd_005fcanonicalize_005fsymtab"></a>
  126. <a name="bfd_005fcanonicalize_005fsymtab"></a>
  127. <h4 class="subsubsection">2.7.5.5 <code>bfd_canonicalize_symtab</code></h4>
  128. <p><strong>Description</strong><br>
  129. Read the symbols from the BFD <var>abfd</var>, and fills in
  130. the vector <var>location</var> with pointers to the symbols and
  131. a trailing NULL.
  132. Return the actual number of symbol pointers, not
  133. including the NULL.
  134. </p><div class="example">
  135. <pre class="example">#define bfd_canonicalize_symtab(abfd, location) \
  136. BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
  137. </pre></div>
  138. <a name="index-bfd_005fset_005fsymtab"></a>
  139. <a name="bfd_005fset_005fsymtab"></a>
  140. <h4 class="subsubsection">2.7.5.6 <code>bfd_set_symtab</code></h4>
  141. <p><strong>Synopsis</strong>
  142. </p><div class="example">
  143. <pre class="example">bfd_boolean bfd_set_symtab
  144. (bfd *abfd, asymbol **location, unsigned int count);
  145. </pre></div>
  146. <p><strong>Description</strong><br>
  147. Arrange that when the output BFD <var>abfd</var> is closed,
  148. the table <var>location</var> of <var>count</var> pointers to symbols
  149. will be written.
  150. </p>
  151. <a name="index-bfd_005fprint_005fsymbol_005fvandf"></a>
  152. <a name="bfd_005fprint_005fsymbol_005fvandf"></a>
  153. <h4 class="subsubsection">2.7.5.7 <code>bfd_print_symbol_vandf</code></h4>
  154. <p><strong>Synopsis</strong>
  155. </p><div class="example">
  156. <pre class="example">void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
  157. </pre></div>
  158. <p><strong>Description</strong><br>
  159. Print the value and flags of the <var>symbol</var> supplied to the
  160. stream <var>file</var>.
  161. </p>
  162. <a name="index-bfd_005fmake_005fempty_005fsymbol"></a>
  163. <a name="bfd_005fmake_005fempty_005fsymbol"></a>
  164. <h4 class="subsubsection">2.7.5.8 <code>bfd_make_empty_symbol</code></h4>
  165. <p><strong>Description</strong><br>
  166. Create a new <code>asymbol</code> structure for the BFD <var>abfd</var>
  167. and return a pointer to it.
  168. </p>
  169. <p>This routine is necessary because each back end has private
  170. information surrounding the <code>asymbol</code>. Building your own
  171. <code>asymbol</code> and pointing to it will not create the private
  172. information, and will cause problems later on.
  173. </p><div class="example">
  174. <pre class="example">#define bfd_make_empty_symbol(abfd) \
  175. BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
  176. </pre></div>
  177. <a name="index-_005fbfd_005fgeneric_005fmake_005fempty_005fsymbol"></a>
  178. <a name="g_t_005fbfd_005fgeneric_005fmake_005fempty_005fsymbol"></a>
  179. <h4 class="subsubsection">2.7.5.9 <code>_bfd_generic_make_empty_symbol</code></h4>
  180. <p><strong>Synopsis</strong>
  181. </p><div class="example">
  182. <pre class="example">asymbol *_bfd_generic_make_empty_symbol (bfd *);
  183. </pre></div>
  184. <p><strong>Description</strong><br>
  185. Create a new <code>asymbol</code> structure for the BFD <var>abfd</var>
  186. and return a pointer to it. Used by core file routines,
  187. binary back-end and anywhere else where no private info
  188. is needed.
  189. </p>
  190. <a name="index-bfd_005fmake_005fdebug_005fsymbol"></a>
  191. <a name="bfd_005fmake_005fdebug_005fsymbol"></a>
  192. <h4 class="subsubsection">2.7.5.10 <code>bfd_make_debug_symbol</code></h4>
  193. <p><strong>Description</strong><br>
  194. Create a new <code>asymbol</code> structure for the BFD <var>abfd</var>,
  195. to be used as a debugging symbol. Further details of its use have
  196. yet to be worked out.
  197. </p><div class="example">
  198. <pre class="example">#define bfd_make_debug_symbol(abfd,ptr,size) \
  199. BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
  200. </pre></div>
  201. <a name="index-bfd_005fdecode_005fsymclass"></a>
  202. <a name="bfd_005fdecode_005fsymclass"></a>
  203. <h4 class="subsubsection">2.7.5.11 <code>bfd_decode_symclass</code></h4>
  204. <p><strong>Description</strong><br>
  205. Return a character corresponding to the symbol
  206. class of <var>symbol</var>, or &rsquo;?&rsquo; for an unknown class.
  207. </p>
  208. <p><strong>Synopsis</strong>
  209. </p><div class="example">
  210. <pre class="example">int bfd_decode_symclass (asymbol *symbol);
  211. </pre></div>
  212. <a name="index-bfd_005fis_005fundefined_005fsymclass"></a>
  213. <a name="bfd_005fis_005fundefined_005fsymclass"></a>
  214. <h4 class="subsubsection">2.7.5.12 <code>bfd_is_undefined_symclass</code></h4>
  215. <p><strong>Description</strong><br>
  216. Returns non-zero if the class symbol returned by
  217. bfd_decode_symclass represents an undefined symbol.
  218. Returns zero otherwise.
  219. </p>
  220. <p><strong>Synopsis</strong>
  221. </p><div class="example">
  222. <pre class="example">bfd_boolean bfd_is_undefined_symclass (int symclass);
  223. </pre></div>
  224. <a name="index-bfd_005fsymbol_005finfo"></a>
  225. <a name="bfd_005fsymbol_005finfo"></a>
  226. <h4 class="subsubsection">2.7.5.13 <code>bfd_symbol_info</code></h4>
  227. <p><strong>Description</strong><br>
  228. Fill in the basic info about symbol that nm needs.
  229. Additional info may be added by the back-ends after
  230. calling this function.
  231. </p>
  232. <p><strong>Synopsis</strong>
  233. </p><div class="example">
  234. <pre class="example">void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
  235. </pre></div>
  236. <a name="index-bfd_005fcopy_005fprivate_005fsymbol_005fdata"></a>
  237. <a name="bfd_005fcopy_005fprivate_005fsymbol_005fdata"></a>
  238. <h4 class="subsubsection">2.7.5.14 <code>bfd_copy_private_symbol_data</code></h4>
  239. <p><strong>Synopsis</strong>
  240. </p><div class="example">
  241. <pre class="example">bfd_boolean bfd_copy_private_symbol_data
  242. (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
  243. </pre></div>
  244. <p><strong>Description</strong><br>
  245. Copy private symbol information from <var>isym</var> in the BFD
  246. <var>ibfd</var> to the symbol <var>osym</var> in the BFD <var>obfd</var>.
  247. Return <code>TRUE</code> on success, <code>FALSE</code> on error. Possible error
  248. returns are:
  249. </p>
  250. <ul>
  251. <li> <code>bfd_error_no_memory</code> -
  252. Not enough memory exists to create private data for <var>osec</var>.
  253. </li></ul>
  254. <div class="example">
  255. <pre class="example">#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
  256. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
  257. (ibfd, isymbol, obfd, osymbol))
  258. </pre></div>
  259. <hr>
  260. <div class="header">
  261. <p>
  262. 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>
  263. </div>
  264. </body>
  265. </html>