libcoff-in.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /* BFD COFF object file private structure.
  2. Copyright (C) 1990-2022 Free Software Foundation, Inc.
  3. Written by Cygnus Support.
  4. This file is part of BFD, the Binary File Descriptor library.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  16. MA 02110-1301, USA. */
  17. #ifndef _LIBCOFF_H
  18. #define _LIBCOFF_H 1
  19. #include "bfdlink.h"
  20. #include "coff-bfd.h"
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Object file tdata; access macros. */
  25. #define coff_data(bfd) ((bfd)->tdata.coff_obj_data)
  26. #define obj_pe(bfd) (coff_data (bfd)->pe)
  27. #define obj_go32(bfd) (coff_data (bfd)->go32)
  28. #define obj_symbols(bfd) (coff_data (bfd)->symbols)
  29. #define obj_sym_filepos(bfd) (coff_data (bfd)->sym_filepos)
  30. #define obj_relocbase(bfd) (coff_data (bfd)->relocbase)
  31. #define obj_raw_syments(bfd) (coff_data (bfd)->raw_syments)
  32. #define obj_raw_syment_count(bfd) (coff_data (bfd)->raw_syment_count)
  33. #define obj_convert(bfd) (coff_data (bfd)->conversion_table)
  34. #define obj_conv_table_size(bfd) (coff_data (bfd)->conv_table_size)
  35. #define obj_coff_external_syms(bfd) (coff_data (bfd)->external_syms)
  36. #define obj_coff_keep_syms(bfd) (coff_data (bfd)->keep_syms)
  37. #define obj_coff_strings(bfd) (coff_data (bfd)->strings)
  38. #define obj_coff_strings_len(bfd) (coff_data (bfd)->strings_len)
  39. #define obj_coff_keep_strings(bfd) (coff_data (bfd)->keep_strings)
  40. #define obj_coff_sym_hashes(bfd) (coff_data (bfd)->sym_hashes)
  41. #define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written)
  42. #define obj_coff_local_toc_table(bfd) (coff_data (bfd)->local_toc_sym_map)
  43. /* `Tdata' information kept for COFF files. */
  44. typedef struct coff_tdata
  45. {
  46. struct coff_symbol_struct *symbols; /* Symtab for input bfd. */
  47. unsigned int *conversion_table;
  48. int conv_table_size;
  49. file_ptr sym_filepos;
  50. struct coff_ptr_struct *raw_syments;
  51. unsigned long raw_syment_count;
  52. /* These are only valid once writing has begun. */
  53. unsigned long int relocbase;
  54. /* These members communicate important constants about the symbol table
  55. to GDB's symbol-reading code. These `constants' unfortunately vary
  56. from coff implementation to implementation... */
  57. unsigned local_n_btmask;
  58. unsigned local_n_btshft;
  59. unsigned local_n_tmask;
  60. unsigned local_n_tshift;
  61. unsigned local_symesz;
  62. unsigned local_auxesz;
  63. unsigned local_linesz;
  64. /* The unswapped external symbols. May be NULL. Read by
  65. _bfd_coff_get_external_symbols. */
  66. void * external_syms;
  67. /* If this is TRUE, the external_syms may not be freed. */
  68. bool keep_syms;
  69. /* The string table. May be NULL. Read by
  70. _bfd_coff_read_string_table. */
  71. char *strings;
  72. /* The length of the strings table. For error checking. */
  73. bfd_size_type strings_len;
  74. /* If this is TRUE, the strings may not be freed. */
  75. bool keep_strings;
  76. /* If this is TRUE, the strings have been written out already. */
  77. bool strings_written;
  78. /* Is this a PE format coff file? */
  79. int pe;
  80. /* Used by the COFF backend linker. */
  81. struct coff_link_hash_entry **sym_hashes;
  82. /* Used by the pe linker for PowerPC. */
  83. int *local_toc_sym_map;
  84. struct bfd_link_info *link_info;
  85. /* Used by coff_find_nearest_line. */
  86. void * line_info;
  87. /* A place to stash dwarf2 info for this bfd. */
  88. void * dwarf2_find_line_info;
  89. /* The timestamp from the COFF file header. */
  90. long timestamp;
  91. /* Copy of some of the f_flags bits in the COFF filehdr structure,
  92. used by ARM code. */
  93. flagword flags;
  94. /* Is this a GO32 coff file? */
  95. bool go32;
  96. /* A stub (extra data prepended before the COFF image) and its size.
  97. Used by coff-go32-exe, it contains executable data that loads the
  98. COFF object into memory. */
  99. char * stub;
  100. bfd_size_type stub_size;
  101. } coff_data_type;
  102. /* Tdata for pe image files. */
  103. typedef struct pe_tdata
  104. {
  105. coff_data_type coff;
  106. struct internal_extra_pe_aouthdr pe_opthdr;
  107. int dll;
  108. int has_reloc_section;
  109. int dont_strip_reloc;
  110. int dos_message[16];
  111. /* The timestamp to insert into the output file.
  112. If the timestamp is -1 then the current time is used. */
  113. int timestamp;
  114. bool (*in_reloc_p) (bfd *, reloc_howto_type *);
  115. flagword real_flags;
  116. /* Build-id info. */
  117. struct
  118. {
  119. bool (*after_write_object_contents) (bfd *);
  120. const char *style;
  121. asection *sec;
  122. } build_id;
  123. } pe_data_type;
  124. #define pe_data(bfd) ((bfd)->tdata.pe_obj_data)
  125. /* Tdata for XCOFF files. */
  126. struct xcoff_tdata
  127. {
  128. /* Basic COFF information. */
  129. coff_data_type coff;
  130. /* TRUE if this is an XCOFF64 file. */
  131. bool xcoff64;
  132. /* TRUE if a large a.out header should be generated. */
  133. bool full_aouthdr;
  134. /* TOC value. */
  135. bfd_vma toc;
  136. /* Index of section holding TOC. */
  137. int sntoc;
  138. /* Index of section holding entry point. */
  139. int snentry;
  140. /* .text alignment from optional header. */
  141. int text_align_power;
  142. /* .data alignment from optional header. */
  143. int data_align_power;
  144. /* modtype from optional header. */
  145. short modtype;
  146. /* cputype from optional header. */
  147. short cputype;
  148. /* maxdata from optional header. */
  149. bfd_vma maxdata;
  150. /* maxstack from optional header. */
  151. bfd_vma maxstack;
  152. /* Used by the XCOFF backend linker. */
  153. asection **csects;
  154. long *debug_indices;
  155. unsigned int *lineno_counts;
  156. unsigned int import_file_id;
  157. };
  158. #define xcoff_data(abfd) ((abfd)->tdata.xcoff_obj_data)
  159. /* We take the address of the first element of an asymbol to ensure that the
  160. macro is only ever applied to an asymbol. */
  161. #define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
  162. /* Tdata for sections in XCOFF files. This is used by the linker. */
  163. struct xcoff_section_tdata
  164. {
  165. /* Used for XCOFF csects created by the linker; points to the real
  166. XCOFF section which contains this csect. */
  167. asection *enclosing;
  168. /* The lineno_count field for the enclosing section, because we are
  169. going to clobber it there. */
  170. unsigned int lineno_count;
  171. /* The first and last symbol indices for symbols used by this csect. */
  172. unsigned long first_symndx;
  173. unsigned long last_symndx;
  174. };
  175. /* An accessor macro the xcoff_section_tdata structure. */
  176. #define xcoff_section_data(abfd, sec) \
  177. ((struct xcoff_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
  178. /* Tdata for sections in PE files. */
  179. struct pei_section_tdata
  180. {
  181. /* The virtual size of the section. */
  182. bfd_size_type virt_size;
  183. /* The PE section flags. */
  184. long pe_flags;
  185. };
  186. /* An accessor macro for the pei_section_tdata structure. */
  187. #define pei_section_data(abfd, sec) \
  188. ((struct pei_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
  189. /* COFF linker hash table entries. */
  190. struct coff_link_hash_entry
  191. {
  192. struct bfd_link_hash_entry root;
  193. /* Symbol index in output file. This is initialized to -1. It is
  194. set to -2 if the symbol is used by a reloc. It is set to -3 if
  195. this symbol is defined in a discarded section. */
  196. long indx;
  197. /* Symbol type. */
  198. unsigned short type;
  199. /* Symbol class. */
  200. unsigned char symbol_class;
  201. /* Number of auxiliary entries. */
  202. char numaux;
  203. /* BFD to take auxiliary entries from. */
  204. bfd *auxbfd;
  205. /* Pointer to array of auxiliary entries, if any. */
  206. union internal_auxent *aux;
  207. /* Flag word; legal values follow. */
  208. unsigned short coff_link_hash_flags;
  209. /* Symbol is a PE section symbol. */
  210. #define COFF_LINK_HASH_PE_SECTION_SYMBOL (01)
  211. };
  212. /* COFF linker hash table. */
  213. struct coff_link_hash_table
  214. {
  215. struct bfd_link_hash_table root;
  216. /* A pointer to information used to link stabs in sections. */
  217. struct stab_info stab_info;
  218. };
  219. struct coff_reloc_cookie
  220. {
  221. struct internal_reloc * rels;
  222. struct internal_reloc * rel;
  223. struct internal_reloc * relend;
  224. struct coff_symbol_struct * symbols; /* Symtab for input bfd. */
  225. bfd * abfd;
  226. struct coff_link_hash_entry ** sym_hashes;
  227. };
  228. /* Look up an entry in a COFF linker hash table. */
  229. #define coff_link_hash_lookup(table, string, create, copy, follow) \
  230. ((struct coff_link_hash_entry *) \
  231. bfd_link_hash_lookup (&(table)->root, (string), (create), \
  232. (copy), (follow)))
  233. /* Traverse a COFF linker hash table. */
  234. #define coff_link_hash_traverse(table, func, info) \
  235. (bfd_link_hash_traverse \
  236. (&(table)->root, \
  237. (bool (*) (struct bfd_link_hash_entry *, void *)) (func), \
  238. (info)))
  239. /* Get the COFF linker hash table from a link_info structure. */
  240. #define coff_hash_table(p) ((struct coff_link_hash_table *) ((p)->hash))
  241. /* Functions in coffgen.c. */
  242. extern bfd_cleanup coff_object_p
  243. (bfd *);
  244. extern struct bfd_section *coff_section_from_bfd_index
  245. (bfd *, int);
  246. extern long coff_get_symtab_upper_bound
  247. (bfd *);
  248. extern long coff_canonicalize_symtab
  249. (bfd *, asymbol **);
  250. extern int coff_count_linenumbers
  251. (bfd *);
  252. extern bool coff_renumber_symbols
  253. (bfd *, int *);
  254. extern void coff_mangle_symbols
  255. (bfd *);
  256. extern bool coff_write_symbols
  257. (bfd *);
  258. extern bool coff_write_alien_symbol
  259. (bfd *, asymbol *, struct internal_syment *, union internal_auxent *,
  260. bfd_vma *, bfd_size_type *, asection **, bfd_size_type *);
  261. extern bool coff_write_linenumbers
  262. (bfd *);
  263. extern alent *coff_get_lineno
  264. (bfd *, asymbol *);
  265. extern asymbol *coff_section_symbol
  266. (bfd *, char *);
  267. extern bool _bfd_coff_get_external_symbols
  268. (bfd *);
  269. extern const char *_bfd_coff_read_string_table
  270. (bfd *);
  271. extern bool _bfd_coff_free_symbols
  272. (bfd *);
  273. extern struct coff_ptr_struct *coff_get_normalized_symtab
  274. (bfd *);
  275. extern long coff_get_reloc_upper_bound
  276. (bfd *, sec_ptr);
  277. extern asymbol *coff_make_empty_symbol
  278. (bfd *);
  279. extern void coff_print_symbol
  280. (bfd *, void * filep, asymbol *, bfd_print_symbol_type);
  281. extern void coff_get_symbol_info
  282. (bfd *, asymbol *, symbol_info *ret);
  283. #define coff_get_symbol_version_string \
  284. _bfd_nosymbols_get_symbol_version_string
  285. extern bool _bfd_coff_is_local_label_name
  286. (bfd *, const char *);
  287. extern asymbol *coff_bfd_make_debug_symbol
  288. (bfd *, void *, unsigned long);
  289. extern bool coff_find_nearest_line
  290. (bfd *, asymbol **, asection *, bfd_vma,
  291. const char **, const char **, unsigned int *, unsigned int *);
  292. #define coff_find_line _bfd_nosymbols_find_line
  293. struct dwarf_debug_section;
  294. extern bool coff_find_nearest_line_with_names
  295. (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **,
  296. unsigned int *, const struct dwarf_debug_section *);
  297. extern bool coff_find_inliner_info
  298. (bfd *, const char **, const char **, unsigned int *);
  299. extern int coff_sizeof_headers
  300. (bfd *, struct bfd_link_info *);
  301. extern bool bfd_coff_reloc16_relax_section
  302. (bfd *, asection *, struct bfd_link_info *, bool *);
  303. extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents
  304. (bfd *, struct bfd_link_info *, struct bfd_link_order *,
  305. bfd_byte *, bool, asymbol **);
  306. extern bfd_vma bfd_coff_reloc16_get_value
  307. (arelent *, struct bfd_link_info *, asection *);
  308. extern void bfd_perform_slip
  309. (bfd *, unsigned int, asection *, bfd_vma);
  310. extern bool _bfd_coff_close_and_cleanup
  311. (bfd *);
  312. /* Functions and types in cofflink.c. */
  313. #define STRING_SIZE_SIZE 4
  314. /* We use a hash table to merge identical enum, struct, and union
  315. definitions in the linker. */
  316. /* Information we keep for a single element (an enum value, a
  317. structure or union field) in the debug merge hash table. */
  318. struct coff_debug_merge_element
  319. {
  320. /* Next element. */
  321. struct coff_debug_merge_element *next;
  322. /* Name. */
  323. const char *name;
  324. /* Type. */
  325. unsigned int type;
  326. /* Symbol index for complex type. */
  327. long tagndx;
  328. };
  329. /* A linked list of debug merge entries for a given name. */
  330. struct coff_debug_merge_type
  331. {
  332. /* Next type with the same name. */
  333. struct coff_debug_merge_type *next;
  334. /* Class of type. */
  335. int type_class;
  336. /* Symbol index where this type is defined. */
  337. long indx;
  338. /* List of elements. */
  339. struct coff_debug_merge_element *elements;
  340. };
  341. /* Information we store in the debug merge hash table. */
  342. struct coff_debug_merge_hash_entry
  343. {
  344. struct bfd_hash_entry root;
  345. /* A list of types with this name. */
  346. struct coff_debug_merge_type *types;
  347. };
  348. /* The debug merge hash table. */
  349. struct coff_debug_merge_hash_table
  350. {
  351. struct bfd_hash_table root;
  352. };
  353. /* Initialize a COFF debug merge hash table. */
  354. #define coff_debug_merge_hash_table_init(table) \
  355. (bfd_hash_table_init (&(table)->root, _bfd_coff_debug_merge_hash_newfunc, \
  356. sizeof (struct coff_debug_merge_hash_entry)))
  357. /* Free a COFF debug merge hash table. */
  358. #define coff_debug_merge_hash_table_free(table) \
  359. (bfd_hash_table_free (&(table)->root))
  360. /* Look up an entry in a COFF debug merge hash table. */
  361. #define coff_debug_merge_hash_lookup(table, string, create, copy) \
  362. ((struct coff_debug_merge_hash_entry *) \
  363. bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
  364. /* Information we keep for each section in the output file when doing
  365. a relocatable link. */
  366. struct coff_link_section_info
  367. {
  368. /* The relocs to be output. */
  369. struct internal_reloc *relocs;
  370. /* For each reloc against a global symbol whose index was not known
  371. when the reloc was handled, the global hash table entry. */
  372. struct coff_link_hash_entry **rel_hashes;
  373. };
  374. /* Information that we pass around while doing the final link step. */
  375. struct coff_final_link_info
  376. {
  377. /* General link information. */
  378. struct bfd_link_info *info;
  379. /* Output BFD. */
  380. bfd *output_bfd;
  381. /* Used to indicate failure in traversal routine. */
  382. bool failed;
  383. /* If doing "task linking" set only during the time when we want the
  384. global symbol writer to convert the storage class of defined global
  385. symbols from global to static. */
  386. bool global_to_static;
  387. /* Hash table for long symbol names. */
  388. struct bfd_strtab_hash *strtab;
  389. /* When doing a relocatable link, an array of information kept for
  390. each output section, indexed by the target_index field. */
  391. struct coff_link_section_info *section_info;
  392. /* Symbol index of last C_FILE symbol (-1 if none). */
  393. long last_file_index;
  394. /* Contents of last C_FILE symbol. */
  395. struct internal_syment last_file;
  396. /* Symbol index of first aux entry of last .bf symbol with an empty
  397. endndx field (-1 if none). */
  398. long last_bf_index;
  399. /* Contents of last_bf_index aux entry. */
  400. union internal_auxent last_bf;
  401. /* Hash table used to merge debug information. */
  402. struct coff_debug_merge_hash_table debug_merge;
  403. /* Buffer large enough to hold swapped symbols of any input file. */
  404. struct internal_syment *internal_syms;
  405. /* Buffer large enough to hold sections of symbols of any input file. */
  406. asection **sec_ptrs;
  407. /* Buffer large enough to hold output indices of symbols of any
  408. input file. */
  409. long *sym_indices;
  410. /* Buffer large enough to hold output symbols for any input file. */
  411. bfd_byte *outsyms;
  412. /* Buffer large enough to hold external line numbers for any input
  413. section. */
  414. bfd_byte *linenos;
  415. /* Buffer large enough to hold any input section. */
  416. bfd_byte *contents;
  417. /* Buffer large enough to hold external relocs of any input section. */
  418. bfd_byte *external_relocs;
  419. /* Buffer large enough to hold swapped relocs of any input section. */
  420. struct internal_reloc *internal_relocs;
  421. };
  422. /* Most COFF variants have no way to record the alignment of a
  423. section. This struct is used to set a specific alignment based on
  424. the name of the section. */
  425. struct coff_section_alignment_entry
  426. {
  427. /* The section name. */
  428. const char *name;
  429. /* This is either (unsigned int) -1, indicating that the section
  430. name must match exactly, or it is the number of letters which
  431. must match at the start of the name. */
  432. unsigned int comparison_length;
  433. /* These macros may be used to fill in the first two fields in a
  434. structure initialization. */
  435. #define COFF_SECTION_NAME_EXACT_MATCH(name) (name), ((unsigned int) -1)
  436. #define COFF_SECTION_NAME_PARTIAL_MATCH(name) (name), (sizeof (name) - 1)
  437. /* Only use this entry if the default section alignment for this
  438. target is at least that much (as a power of two). If this field
  439. is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */
  440. unsigned int default_alignment_min;
  441. /* Only use this entry if the default section alignment for this
  442. target is no greater than this (as a power of two). If this
  443. field is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */
  444. unsigned int default_alignment_max;
  445. #define COFF_ALIGNMENT_FIELD_EMPTY ((unsigned int) -1)
  446. /* The desired alignment for this section (as a power of two). */
  447. unsigned int alignment_power;
  448. };
  449. extern struct bfd_hash_entry *_bfd_coff_link_hash_newfunc
  450. (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
  451. extern bool _bfd_coff_link_hash_table_init
  452. (struct coff_link_hash_table *, bfd *,
  453. struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
  454. struct bfd_hash_table *,
  455. const char *),
  456. unsigned int);
  457. extern struct bfd_link_hash_table *_bfd_coff_link_hash_table_create
  458. (bfd *);
  459. extern const char *_bfd_coff_internal_syment_name
  460. (bfd *, const struct internal_syment *, char *);
  461. extern bool _bfd_coff_section_already_linked
  462. (bfd *, asection *, struct bfd_link_info *);
  463. extern bool _bfd_coff_link_add_symbols
  464. (bfd *, struct bfd_link_info *);
  465. extern bool _bfd_coff_final_link
  466. (bfd *, struct bfd_link_info *);
  467. extern struct internal_reloc *_bfd_coff_read_internal_relocs
  468. (bfd *, asection *, bool, bfd_byte *, bool,
  469. struct internal_reloc *);
  470. extern bool _bfd_coff_generic_relocate_section
  471. (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
  472. struct internal_reloc *, struct internal_syment *, asection **);
  473. extern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc
  474. (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
  475. extern bool _bfd_coff_write_global_sym
  476. (struct bfd_hash_entry *, void *);
  477. extern bool _bfd_coff_write_task_globals
  478. (struct coff_link_hash_entry *, void *);
  479. extern bool _bfd_coff_link_input_bfd
  480. (struct coff_final_link_info *, bfd *);
  481. extern bool _bfd_coff_reloc_link_order
  482. (bfd *, struct coff_final_link_info *, asection *,
  483. struct bfd_link_order *);
  484. extern bool bfd_coff_gc_sections
  485. (bfd *, struct bfd_link_info *);
  486. extern const char *bfd_coff_group_name
  487. (bfd *, const asection *);
  488. #define coff_get_section_contents_in_window \
  489. _bfd_generic_get_section_contents_in_window
  490. /* Functions in xcofflink.c. */
  491. extern long _bfd_xcoff_get_dynamic_symtab_upper_bound
  492. (bfd *);
  493. extern long _bfd_xcoff_canonicalize_dynamic_symtab
  494. (bfd *, asymbol **);
  495. extern long _bfd_xcoff_get_dynamic_reloc_upper_bound
  496. (bfd *);
  497. extern long _bfd_xcoff_canonicalize_dynamic_reloc
  498. (bfd *, arelent **, asymbol **);
  499. extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create
  500. (bfd *);
  501. extern bool _bfd_xcoff_bfd_link_add_symbols
  502. (bfd *, struct bfd_link_info *);
  503. extern bool _bfd_xcoff_bfd_final_link
  504. (bfd *, struct bfd_link_info *);
  505. extern bool _bfd_xcoff_define_common_symbol
  506. (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
  507. extern bool _bfd_ppc_xcoff_relocate_section
  508. (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
  509. struct internal_reloc *, struct internal_syment *, asection **);