xref: /openbsd/gnu/usr.bin/binutils/bfd/doc/syms.texi (revision cf2f2c56)
1fddef416Sniklas@section Symbols
2fddef416SniklasBFD tries to maintain as much symbol information as it can when
3fddef416Sniklasit moves information from file to file. BFD passes information
4fddef416Sniklasto applications though the @code{asymbol} structure. When the
5fddef416Sniklasapplication requests the symbol table, BFD reads the table in
6fddef416Sniklasthe native form and translates parts of it into the internal
7fddef416Sniklasformat. To maintain more than the information passed to
8fddef416Sniklasapplications, some targets keep some information ``behind the
9fddef416Sniklasscenes'' in a structure only the particular back end knows
10fddef416Sniklasabout. For example, the coff back end keeps the original
11fddef416Sniklassymbol table structure as well as the canonical structure when
12fddef416Sniklasa BFD is read in. On output, the coff back end can reconstruct
13fddef416Sniklasthe output symbol table so that no information is lost, even
14fddef416Sniklasinformation unique to coff which BFD doesn't know or
15fddef416Sniklasunderstand. If a coff symbol table were read, but were written
16fddef416Sniklasthrough an a.out back end, all the coff specific information
17fddef416Sniklaswould be lost. The symbol table of a BFD
18fddef416Sniklasis not necessarily read in until a canonicalize request is
19fddef416Sniklasmade. Then the BFD back end fills in a table provided by the
20fddef416Sniklasapplication with pointers to the canonical information.  To
21fddef416Sniklasoutput symbols, the application provides BFD with a table of
22fddef416Sniklaspointers to pointers to @code{asymbol}s. This allows applications
23fddef416Sniklaslike the linker to output a symbol as it was read, since the ``behind
24fddef416Sniklasthe scenes'' information will be still available.
25fddef416Sniklas@menu
26fddef416Sniklas* Reading Symbols::
27fddef416Sniklas* Writing Symbols::
28fddef416Sniklas* Mini Symbols::
29fddef416Sniklas* typedef asymbol::
30fddef416Sniklas* symbol handling functions::
31fddef416Sniklas@end menu
32f7cc78ecSespie
33fddef416Sniklas@node Reading Symbols, Writing Symbols, Symbols, Symbols
34fddef416Sniklas@subsection Reading symbols
35fddef416SniklasThere are two stages to reading a symbol table from a BFD:
36fddef416Sniklasallocating storage, and the actual reading process. This is an
37fddef416Sniklasexcerpt from an application which reads the symbol table:
38fddef416Sniklas
39fddef416Sniklas@example
40fddef416Sniklas         long storage_needed;
41fddef416Sniklas         asymbol **symbol_table;
42fddef416Sniklas         long number_of_symbols;
43fddef416Sniklas         long i;
44fddef416Sniklas
45fddef416Sniklas         storage_needed = bfd_get_symtab_upper_bound (abfd);
46fddef416Sniklas
47fddef416Sniklas         if (storage_needed < 0)
48fddef416Sniklas           FAIL
49fddef416Sniklas
50d2201f2fSdrahn         if (storage_needed == 0)
51fddef416Sniklas           return;
52d2201f2fSdrahn
53*cf2f2c56Smiod         symbol_table = xmalloc (storage_needed);
54fddef416Sniklas           ...
55fddef416Sniklas         number_of_symbols =
56fddef416Sniklas            bfd_canonicalize_symtab (abfd, symbol_table);
57fddef416Sniklas
58fddef416Sniklas         if (number_of_symbols < 0)
59fddef416Sniklas           FAIL
60fddef416Sniklas
61d2201f2fSdrahn         for (i = 0; i < number_of_symbols; i++)
62fddef416Sniklas           process_symbol (symbol_table[i]);
63fddef416Sniklas@end example
64fddef416Sniklas
65fddef416SniklasAll storage for the symbols themselves is in an objalloc
66fddef416Sniklasconnected to the BFD; it is freed when the BFD is closed.
67f7cc78ecSespie
68fddef416Sniklas@node Writing Symbols, Mini Symbols, Reading Symbols, Symbols
69fddef416Sniklas@subsection Writing symbols
70fddef416SniklasWriting of a symbol table is automatic when a BFD open for
71fddef416Sniklaswriting is closed. The application attaches a vector of
72fddef416Sniklaspointers to pointers to symbols to the BFD being written, and
73fddef416Sniklasfills in the symbol count. The close and cleanup code reads
74fddef416Sniklasthrough the table provided and performs all the necessary
75fddef416Sniklasoperations. The BFD output code must always be provided with an
76fddef416Sniklas``owned'' symbol: one which has come from another BFD, or one
77fddef416Sniklaswhich has been created using @code{bfd_make_empty_symbol}.  Here is an
78fddef416Sniklasexample showing the creation of a symbol table with only one element:
79fddef416Sniklas
80fddef416Sniklas@example
81fddef416Sniklas       #include "bfd.h"
82d2201f2fSdrahn       int main (void)
83fddef416Sniklas       @{
84fddef416Sniklas         bfd *abfd;
85fddef416Sniklas         asymbol *ptrs[2];
86fddef416Sniklas         asymbol *new;
87fddef416Sniklas
88fddef416Sniklas         abfd = bfd_openw ("foo","a.out-sunos-big");
89fddef416Sniklas         bfd_set_format (abfd, bfd_object);
90fddef416Sniklas         new = bfd_make_empty_symbol (abfd);
91fddef416Sniklas         new->name = "dummy_symbol";
92fddef416Sniklas         new->section = bfd_make_section_old_way (abfd, ".text");
93fddef416Sniklas         new->flags = BSF_GLOBAL;
94fddef416Sniklas         new->value = 0x12345;
95fddef416Sniklas
96fddef416Sniklas         ptrs[0] = new;
97*cf2f2c56Smiod         ptrs[1] = 0;
98fddef416Sniklas
99fddef416Sniklas         bfd_set_symtab (abfd, ptrs, 1);
100fddef416Sniklas         bfd_close (abfd);
101d2201f2fSdrahn         return 0;
102fddef416Sniklas       @}
103fddef416Sniklas
104fddef416Sniklas       ./makesym
105fddef416Sniklas       nm foo
106fddef416Sniklas       00012345 A dummy_symbol
107fddef416Sniklas@end example
108fddef416Sniklas
109*cf2f2c56SmiodMany formats cannot represent arbitrary symbol information; for
110fddef416Sniklasinstance, the @code{a.out} object format does not allow an
111*cf2f2c56Smiodarbitrary number of sections. A symbol pointing to a section
112fddef416Sniklaswhich is not one  of @code{.text}, @code{.data} or @code{.bss} cannot
113fddef416Sniklasbe described.
114f7cc78ecSespie
115fddef416Sniklas@node Mini Symbols, typedef asymbol, Writing Symbols, Symbols
116fddef416Sniklas@subsection Mini Symbols
117fddef416SniklasMini symbols provide read-only access to the symbol table.
118fddef416SniklasThey use less memory space, but require more time to access.
119fddef416SniklasThey can be useful for tools like nm or objdump, which may
120fddef416Sniklashave to handle symbol tables of extremely large executables.
121fddef416Sniklas
122fddef416SniklasThe @code{bfd_read_minisymbols} function will read the symbols
123fddef416Sniklasinto memory in an internal form.  It will return a @code{void *}
124fddef416Sniklaspointer to a block of memory, a symbol count, and the size of
125fddef416Sniklaseach symbol.  The pointer is allocated using @code{malloc}, and
126fddef416Sniklasshould be freed by the caller when it is no longer needed.
127fddef416Sniklas
128fddef416SniklasThe function @code{bfd_minisymbol_to_symbol} will take a pointer
129fddef416Sniklasto a minisymbol, and a pointer to a structure returned by
130fddef416Sniklas@code{bfd_make_empty_symbol}, and return a @code{asymbol} structure.
131fddef416SniklasThe return value may or may not be the same as the value from
132fddef416Sniklas@code{bfd_make_empty_symbol} which was passed in.
133f7cc78ecSespie
134fddef416Sniklas
135fddef416Sniklas@node typedef asymbol, symbol handling functions, Mini Symbols, Symbols
136fddef416Sniklas@subsection typedef asymbol
137fddef416SniklasAn @code{asymbol} has the form:
138f7cc78ecSespie
139f7cc78ecSespie
140fddef416Sniklas@example
141f7cc78ecSespie
142*cf2f2c56Smiodtypedef struct bfd_symbol
143fddef416Sniklas@{
144fddef416Sniklas  /* A pointer to the BFD which owns the symbol. This information
145fddef416Sniklas     is necessary so that a back end can work out what additional
146fddef416Sniklas     information (invisible to the application writer) is carried
147fddef416Sniklas     with the symbol.
148fddef416Sniklas
149fddef416Sniklas     This field is *almost* redundant, since you can use section->owner
150fddef416Sniklas     instead, except that some symbols point to the global sections
151fddef416Sniklas     bfd_@{abs,com,und@}_section.  This could be fixed by making
152fddef416Sniklas     these globals be per-bfd (or per-target-flavor).  FIXME.  */
153d2201f2fSdrahn  struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field.  */
154fddef416Sniklas
155fddef416Sniklas  /* The text of the symbol. The name is left alone, and not copied; the
156fddef416Sniklas     application may not alter it.  */
157d2201f2fSdrahn  const char *name;
158fddef416Sniklas
159fddef416Sniklas  /* The value of the symbol.  This really should be a union of a
160fddef416Sniklas     numeric value with a pointer, since some flags indicate that
161fddef416Sniklas     a pointer to another symbol is stored here.  */
162fddef416Sniklas  symvalue value;
163fddef416Sniklas
164d2201f2fSdrahn  /* Attributes of a symbol.  */
165fddef416Sniklas#define BSF_NO_FLAGS    0x00
166fddef416Sniklas
167fddef416Sniklas  /* The symbol has local scope; @code{static} in @code{C}. The value
168fddef416Sniklas     is the offset into the section of the data.  */
169fddef416Sniklas#define BSF_LOCAL      0x01
170fddef416Sniklas
171fddef416Sniklas  /* The symbol has global scope; initialized data in @code{C}. The
172fddef416Sniklas     value is the offset into the section of the data.  */
173fddef416Sniklas#define BSF_GLOBAL     0x02
174fddef416Sniklas
175fddef416Sniklas  /* The symbol has global scope and is exported. The value is
176fddef416Sniklas     the offset into the section of the data.  */
177d2201f2fSdrahn#define BSF_EXPORT     BSF_GLOBAL /* No real difference.  */
178fddef416Sniklas
179fddef416Sniklas  /* A normal C symbol would be one of:
180fddef416Sniklas     @code{BSF_LOCAL}, @code{BSF_FORT_COMM},  @code{BSF_UNDEFINED} or
181d2201f2fSdrahn     @code{BSF_GLOBAL}.  */
182fddef416Sniklas
183*cf2f2c56Smiod  /* The symbol is a debugging record. The value has an arbitrary
184f7cc78ecSespie     meaning, unless BSF_DEBUGGING_RELOC is also set.  */
185fddef416Sniklas#define BSF_DEBUGGING  0x08
186fddef416Sniklas
187fddef416Sniklas  /* The symbol denotes a function entry point.  Used in ELF,
188fddef416Sniklas     perhaps others someday.  */
189fddef416Sniklas#define BSF_FUNCTION    0x10
190fddef416Sniklas
191fddef416Sniklas  /* Used by the linker.  */
192fddef416Sniklas#define BSF_KEEP        0x20
193fddef416Sniklas#define BSF_KEEP_G      0x40
194fddef416Sniklas
195fddef416Sniklas  /* A weak global symbol, overridable without warnings by
196fddef416Sniklas     a regular global symbol of the same name.  */
197fddef416Sniklas#define BSF_WEAK        0x80
198fddef416Sniklas
199fddef416Sniklas  /* This symbol was created to point to a section, e.g. ELF's
200fddef416Sniklas     STT_SECTION symbols.  */
201fddef416Sniklas#define BSF_SECTION_SYM 0x100
202fddef416Sniklas
203fddef416Sniklas  /* The symbol used to be a common symbol, but now it is
204fddef416Sniklas     allocated.  */
205fddef416Sniklas#define BSF_OLD_COMMON  0x200
206fddef416Sniklas
207fddef416Sniklas  /* The default value for common data.  */
208fddef416Sniklas#define BFD_FORT_COMM_DEFAULT_VALUE 0
209fddef416Sniklas
210fddef416Sniklas  /* In some files the type of a symbol sometimes alters its
211fddef416Sniklas     location in an output file - ie in coff a @code{ISFCN} symbol
212fddef416Sniklas     which is also @code{C_EXT} symbol appears where it was
213fddef416Sniklas     declared and not at the end of a section.  This bit is set
214fddef416Sniklas     by the target BFD part to convey this information.  */
215fddef416Sniklas#define BSF_NOT_AT_END    0x400
216fddef416Sniklas
217fddef416Sniklas  /* Signal that the symbol is the label of constructor section.  */
218fddef416Sniklas#define BSF_CONSTRUCTOR   0x800
219fddef416Sniklas
220fddef416Sniklas  /* Signal that the symbol is a warning symbol.  The name is a
221fddef416Sniklas     warning.  The name of the next symbol is the one to warn about;
222fddef416Sniklas     if a reference is made to a symbol with the same name as the next
223fddef416Sniklas     symbol, a warning is issued by the linker.  */
224fddef416Sniklas#define BSF_WARNING       0x1000
225fddef416Sniklas
226fddef416Sniklas  /* Signal that the symbol is indirect.  This symbol is an indirect
227fddef416Sniklas     pointer to the symbol with the same name as the next symbol.  */
228fddef416Sniklas#define BSF_INDIRECT      0x2000
229fddef416Sniklas
230fddef416Sniklas  /* BSF_FILE marks symbols that contain a file name.  This is used
231fddef416Sniklas     for ELF STT_FILE symbols.  */
232fddef416Sniklas#define BSF_FILE          0x4000
233fddef416Sniklas
234fddef416Sniklas  /* Symbol is from dynamic linking information.  */
235fddef416Sniklas#define BSF_DYNAMIC       0x8000
236fddef416Sniklas
237fddef416Sniklas  /* The symbol denotes a data object.  Used in ELF, and perhaps
238fddef416Sniklas     others someday.  */
239fddef416Sniklas#define BSF_OBJECT        0x10000
240fddef416Sniklas
241f7cc78ecSespie  /* This symbol is a debugging symbol.  The value is the offset
242f7cc78ecSespie     into the section of the data.  BSF_DEBUGGING should be set
243f7cc78ecSespie     as well.  */
244f7cc78ecSespie#define BSF_DEBUGGING_RELOC 0x20000
245f7cc78ecSespie
246d2201f2fSdrahn  /* This symbol is thread local.  Used in ELF.  */
247d2201f2fSdrahn#define BSF_THREAD_LOCAL  0x40000
248d2201f2fSdrahn
249fddef416Sniklas  flagword flags;
250fddef416Sniklas
251fddef416Sniklas  /* A pointer to the section to which this symbol is
252fddef416Sniklas     relative.  This will always be non NULL, there are special
253fddef416Sniklas     sections for undefined and absolute symbols.  */
254*cf2f2c56Smiod  struct bfd_section *section;
255fddef416Sniklas
256fddef416Sniklas  /* Back end special data.  */
257fddef416Sniklas  union
258fddef416Sniklas    @{
259*cf2f2c56Smiod      void *p;
260fddef416Sniklas      bfd_vma i;
261d2201f2fSdrahn    @}
262d2201f2fSdrahn  udata;
263d2201f2fSdrahn@}
264d2201f2fSdrahnasymbol;
265fddef416Sniklas
266fddef416Sniklas@end example
267fddef416Sniklas
268fddef416Sniklas@node symbol handling functions,  , typedef asymbol, Symbols
269fddef416Sniklas@subsection Symbol handling functions
270fddef416Sniklas
271f7cc78ecSespie
272fddef416Sniklas@findex bfd_get_symtab_upper_bound
273fddef416Sniklas@subsubsection @code{bfd_get_symtab_upper_bound}
274fddef416Sniklas@strong{Description}@*
275fddef416SniklasReturn the number of bytes required to store a vector of pointers
276fddef416Sniklasto @code{asymbols} for all the symbols in the BFD @var{abfd},
277fddef416Sniklasincluding a terminal NULL pointer. If there are no symbols in
278fddef416Sniklasthe BFD, then return 0.  If an error occurs, return -1.
279fddef416Sniklas@example
280fddef416Sniklas#define bfd_get_symtab_upper_bound(abfd) \
281fddef416Sniklas     BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
282d2201f2fSdrahn
283fddef416Sniklas@end example
284f7cc78ecSespie
285fddef416Sniklas@findex bfd_is_local_label
286fddef416Sniklas@subsubsection @code{bfd_is_local_label}
287fddef416Sniklas@strong{Synopsis}
288fddef416Sniklas@example
289d2201f2fSdrahnbfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
290fddef416Sniklas@end example
291fddef416Sniklas@strong{Description}@*
292d2201f2fSdrahnReturn TRUE if the given symbol @var{sym} in the BFD @var{abfd} is
293d2201f2fSdrahna compiler generated local label, else return FALSE.
294f7cc78ecSespie
295fddef416Sniklas@findex bfd_is_local_label_name
296fddef416Sniklas@subsubsection @code{bfd_is_local_label_name}
297fddef416Sniklas@strong{Synopsis}
298fddef416Sniklas@example
299d2201f2fSdrahnbfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
300fddef416Sniklas@end example
301fddef416Sniklas@strong{Description}@*
302d2201f2fSdrahnReturn TRUE if a symbol with the name @var{name} in the BFD
303fddef416Sniklas@var{abfd} is a compiler generated local label, else return
304d2201f2fSdrahnFALSE.  This just checks whether the name has the form of a
305fddef416Sniklaslocal label.
306fddef416Sniklas@example
307fddef416Sniklas#define bfd_is_local_label_name(abfd, name) \
308fddef416Sniklas  BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
309d2201f2fSdrahn
310fddef416Sniklas@end example
311f7cc78ecSespie
312fddef416Sniklas@findex bfd_canonicalize_symtab
313fddef416Sniklas@subsubsection @code{bfd_canonicalize_symtab}
314fddef416Sniklas@strong{Description}@*
315fddef416SniklasRead the symbols from the BFD @var{abfd}, and fills in
316fddef416Sniklasthe vector @var{location} with pointers to the symbols and
317fddef416Sniklasa trailing NULL.
318fddef416SniklasReturn the actual number of symbol pointers, not
319fddef416Sniklasincluding the NULL.
320fddef416Sniklas@example
321fddef416Sniklas#define bfd_canonicalize_symtab(abfd, location) \
322*cf2f2c56Smiod  BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
323d2201f2fSdrahn
324fddef416Sniklas@end example
325f7cc78ecSespie
326fddef416Sniklas@findex bfd_set_symtab
327fddef416Sniklas@subsubsection @code{bfd_set_symtab}
328fddef416Sniklas@strong{Synopsis}
329fddef416Sniklas@example
330*cf2f2c56Smiodbfd_boolean bfd_set_symtab
331*cf2f2c56Smiod   (bfd *abfd, asymbol **location, unsigned int count);
332fddef416Sniklas@end example
333fddef416Sniklas@strong{Description}@*
334fddef416SniklasArrange that when the output BFD @var{abfd} is closed,
335fddef416Sniklasthe table @var{location} of @var{count} pointers to symbols
336fddef416Sniklaswill be written.
337f7cc78ecSespie
338fddef416Sniklas@findex bfd_print_symbol_vandf
339fddef416Sniklas@subsubsection @code{bfd_print_symbol_vandf}
340fddef416Sniklas@strong{Synopsis}
341fddef416Sniklas@example
342*cf2f2c56Smiodvoid bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
343fddef416Sniklas@end example
344fddef416Sniklas@strong{Description}@*
345fddef416SniklasPrint the value and flags of the @var{symbol} supplied to the
346fddef416Sniklasstream @var{file}.
347f7cc78ecSespie
348fddef416Sniklas@findex bfd_make_empty_symbol
349fddef416Sniklas@subsubsection @code{bfd_make_empty_symbol}
350fddef416Sniklas@strong{Description}@*
351fddef416SniklasCreate a new @code{asymbol} structure for the BFD @var{abfd}
352fddef416Sniklasand return a pointer to it.
353fddef416Sniklas
354fddef416SniklasThis routine is necessary because each back end has private
355fddef416Sniklasinformation surrounding the @code{asymbol}. Building your own
356fddef416Sniklas@code{asymbol} and pointing to it will not create the private
357fddef416Sniklasinformation, and will cause problems later on.
358fddef416Sniklas@example
359fddef416Sniklas#define bfd_make_empty_symbol(abfd) \
360fddef416Sniklas  BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
361d2201f2fSdrahn
362fddef416Sniklas@end example
363f7cc78ecSespie
364d2201f2fSdrahn@findex _bfd_generic_make_empty_symbol
365d2201f2fSdrahn@subsubsection @code{_bfd_generic_make_empty_symbol}
366d2201f2fSdrahn@strong{Synopsis}
367d2201f2fSdrahn@example
368d2201f2fSdrahnasymbol *_bfd_generic_make_empty_symbol (bfd *);
369d2201f2fSdrahn@end example
370d2201f2fSdrahn@strong{Description}@*
371d2201f2fSdrahnCreate a new @code{asymbol} structure for the BFD @var{abfd}
372d2201f2fSdrahnand return a pointer to it.  Used by core file routines,
373d2201f2fSdrahnbinary back-end and anywhere else where no private info
374d2201f2fSdrahnis needed.
375d2201f2fSdrahn
376fddef416Sniklas@findex bfd_make_debug_symbol
377fddef416Sniklas@subsubsection @code{bfd_make_debug_symbol}
378fddef416Sniklas@strong{Description}@*
379fddef416SniklasCreate a new @code{asymbol} structure for the BFD @var{abfd},
380fddef416Sniklasto be used as a debugging symbol.  Further details of its use have
381fddef416Sniklasyet to be worked out.
382fddef416Sniklas@example
383fddef416Sniklas#define bfd_make_debug_symbol(abfd,ptr,size) \
384fddef416Sniklas  BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
385d2201f2fSdrahn
386fddef416Sniklas@end example
387f7cc78ecSespie
388fddef416Sniklas@findex bfd_decode_symclass
389fddef416Sniklas@subsubsection @code{bfd_decode_symclass}
390fddef416Sniklas@strong{Description}@*
391fddef416SniklasReturn a character corresponding to the symbol
392fddef416Sniklasclass of @var{symbol}, or '?' for an unknown class.
393f7cc78ecSespie
394fddef416Sniklas@strong{Synopsis}
395fddef416Sniklas@example
396fddef416Sniklasint bfd_decode_symclass (asymbol *symbol);
397fddef416Sniklas@end example
398f7cc78ecSespie@findex bfd_is_undefined_symclass
399f7cc78ecSespie@subsubsection @code{bfd_is_undefined_symclass}
400f7cc78ecSespie@strong{Description}@*
401f7cc78ecSespieReturns non-zero if the class symbol returned by
402f7cc78ecSespiebfd_decode_symclass represents an undefined symbol.
403f7cc78ecSespieReturns zero otherwise.
404f7cc78ecSespie
405f7cc78ecSespie@strong{Synopsis}
406f7cc78ecSespie@example
407d2201f2fSdrahnbfd_boolean bfd_is_undefined_symclass (int symclass);
408f7cc78ecSespie@end example
409fddef416Sniklas@findex bfd_symbol_info
410fddef416Sniklas@subsubsection @code{bfd_symbol_info}
411fddef416Sniklas@strong{Description}@*
412fddef416SniklasFill in the basic info about symbol that nm needs.
413fddef416SniklasAdditional info may be added by the back-ends after
414fddef416Sniklascalling this function.
415f7cc78ecSespie
416fddef416Sniklas@strong{Synopsis}
417fddef416Sniklas@example
418fddef416Sniklasvoid bfd_symbol_info (asymbol *symbol, symbol_info *ret);
419fddef416Sniklas@end example
420fddef416Sniklas@findex bfd_copy_private_symbol_data
421fddef416Sniklas@subsubsection @code{bfd_copy_private_symbol_data}
422fddef416Sniklas@strong{Synopsis}
423fddef416Sniklas@example
424*cf2f2c56Smiodbfd_boolean bfd_copy_private_symbol_data
425*cf2f2c56Smiod   (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
426fddef416Sniklas@end example
427fddef416Sniklas@strong{Description}@*
428fddef416SniklasCopy private symbol information from @var{isym} in the BFD
429fddef416Sniklas@var{ibfd} to the symbol @var{osym} in the BFD @var{obfd}.
430d2201f2fSdrahnReturn @code{TRUE} on success, @code{FALSE} on error.  Possible error
431fddef416Sniklasreturns are:
432fddef416Sniklas
433fddef416Sniklas@itemize @bullet
434fddef416Sniklas
435fddef416Sniklas@item
436fddef416Sniklas@code{bfd_error_no_memory} -
437fddef416SniklasNot enough memory exists to create private data for @var{osec}.
438fddef416Sniklas@end itemize
439fddef416Sniklas@example
440fddef416Sniklas#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
441fddef416Sniklas  BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
442fddef416Sniklas            (ibfd, isymbol, obfd, osymbol))
443d2201f2fSdrahn
444fddef416Sniklas@end example
445f7cc78ecSespie
446