libpei.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. /* Support for the generic parts of PE/PEI; common header information.
  2. Copyright (C) 1995-2022 Free Software Foundation, Inc.
  3. Written by Cygnus Solutions.
  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. /* Most of this hacked by Steve Chamberlain,
  18. sac@cygnus.com
  19. PE/PEI rearrangement (and code added): Donn Terry
  20. Softway Systems, Inc. */
  21. /* Hey look, some documentation [and in a place you expect to find it]!
  22. The main reference for the pei format is "Microsoft Portable Executable
  23. and Common Object File Format Specification 4.1". Get it if you need to
  24. do some serious hacking on this code.
  25. Another reference:
  26. "Peering Inside the PE: A Tour of the Win32 Portable Executable
  27. File Format", MSJ 1994, Volume 9.
  28. The *sole* difference between the pe format and the pei format is that the
  29. latter has an MSDOS 2.0 .exe header on the front that prints the message
  30. "This app must be run under Windows." (or some such).
  31. (FIXME: Whether that statement is *really* true or not is unknown.
  32. Are there more subtle differences between pe and pei formats?
  33. For now assume there aren't. If you find one, then for God sakes
  34. document it here!)
  35. The Microsoft docs use the word "image" instead of "executable" because
  36. the former can also refer to a DLL (shared library). Confusion can arise
  37. because the `i' in `pei' also refers to "image". The `pe' format can
  38. also create images (i.e. executables), it's just that to run on a win32
  39. system you need to use the pei format.
  40. FIXME: Please add more docs here so the next poor fool that has to hack
  41. on this code has a chance of getting something accomplished without
  42. wasting too much time. */
  43. #ifndef GET_FCN_LNNOPTR
  44. #define GET_FCN_LNNOPTR(abfd, ext) \
  45. H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
  46. #endif
  47. #ifndef GET_FCN_ENDNDX
  48. #define GET_FCN_ENDNDX(abfd, ext) \
  49. H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx)
  50. #endif
  51. #ifndef PUT_FCN_LNNOPTR
  52. #define PUT_FCN_LNNOPTR(abfd, in, ext) \
  53. H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
  54. #endif
  55. #ifndef PUT_FCN_ENDNDX
  56. #define PUT_FCN_ENDNDX(abfd, in, ext) \
  57. H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_endndx)
  58. #endif
  59. #ifndef GET_LNSZ_LNNO
  60. #define GET_LNSZ_LNNO(abfd, ext) \
  61. H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno)
  62. #endif
  63. #ifndef GET_LNSZ_SIZE
  64. #define GET_LNSZ_SIZE(abfd, ext) \
  65. H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_size)
  66. #endif
  67. #ifndef PUT_LNSZ_LNNO
  68. #define PUT_LNSZ_LNNO(abfd, in, ext) \
  69. H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_lnno)
  70. #endif
  71. #ifndef PUT_LNSZ_SIZE
  72. #define PUT_LNSZ_SIZE(abfd, in, ext) \
  73. H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_size)
  74. #endif
  75. #ifndef GET_SCN_SCNLEN
  76. #define GET_SCN_SCNLEN(abfd, ext) \
  77. H_GET_32 (abfd, ext->x_scn.x_scnlen)
  78. #endif
  79. #ifndef GET_SCN_NRELOC
  80. #define GET_SCN_NRELOC(abfd, ext) \
  81. H_GET_16 (abfd, ext->x_scn.x_nreloc)
  82. #endif
  83. #ifndef GET_SCN_NLINNO
  84. #define GET_SCN_NLINNO(abfd, ext) \
  85. H_GET_16 (abfd, ext->x_scn.x_nlinno)
  86. #endif
  87. #ifndef PUT_SCN_SCNLEN
  88. #define PUT_SCN_SCNLEN(abfd, in, ext) \
  89. H_PUT_32(abfd, in, ext->x_scn.x_scnlen)
  90. #endif
  91. #ifndef PUT_SCN_NRELOC
  92. #define PUT_SCN_NRELOC(abfd, in, ext) \
  93. H_PUT_16(abfd, in, ext->x_scn.x_nreloc)
  94. #endif
  95. #ifndef PUT_SCN_NLINNO
  96. #define PUT_SCN_NLINNO(abfd, in, ext) \
  97. H_PUT_16(abfd,in, ext->x_scn.x_nlinno)
  98. #endif
  99. #ifndef GET_LINENO_LNNO
  100. #define GET_LINENO_LNNO(abfd, ext) \
  101. H_GET_16 (abfd, ext->l_lnno);
  102. #endif
  103. #ifndef PUT_LINENO_LNNO
  104. #define PUT_LINENO_LNNO(abfd, val, ext) \
  105. H_PUT_16(abfd,val, ext->l_lnno);
  106. #endif
  107. /* The f_symptr field in the filehdr is sometimes 64 bits. */
  108. #ifndef GET_FILEHDR_SYMPTR
  109. #define GET_FILEHDR_SYMPTR H_GET_32
  110. #endif
  111. #ifndef PUT_FILEHDR_SYMPTR
  112. #define PUT_FILEHDR_SYMPTR H_PUT_32
  113. #endif
  114. /* Some fields in the aouthdr are sometimes 64 bits. */
  115. #ifndef GET_AOUTHDR_TSIZE
  116. #define GET_AOUTHDR_TSIZE H_GET_32
  117. #endif
  118. #ifndef PUT_AOUTHDR_TSIZE
  119. #define PUT_AOUTHDR_TSIZE H_PUT_32
  120. #endif
  121. #ifndef GET_AOUTHDR_DSIZE
  122. #define GET_AOUTHDR_DSIZE H_GET_32
  123. #endif
  124. #ifndef PUT_AOUTHDR_DSIZE
  125. #define PUT_AOUTHDR_DSIZE H_PUT_32
  126. #endif
  127. #ifndef GET_AOUTHDR_BSIZE
  128. #define GET_AOUTHDR_BSIZE H_GET_32
  129. #endif
  130. #ifndef PUT_AOUTHDR_BSIZE
  131. #define PUT_AOUTHDR_BSIZE H_PUT_32
  132. #endif
  133. #ifndef GET_AOUTHDR_ENTRY
  134. #define GET_AOUTHDR_ENTRY H_GET_32
  135. #endif
  136. #ifndef PUT_AOUTHDR_ENTRY
  137. #define PUT_AOUTHDR_ENTRY H_PUT_32
  138. #endif
  139. #ifndef GET_AOUTHDR_TEXT_START
  140. #define GET_AOUTHDR_TEXT_START H_GET_32
  141. #endif
  142. #ifndef PUT_AOUTHDR_TEXT_START
  143. #define PUT_AOUTHDR_TEXT_START H_PUT_32
  144. #endif
  145. #ifndef GET_AOUTHDR_DATA_START
  146. #define GET_AOUTHDR_DATA_START H_GET_32
  147. #endif
  148. #ifndef PUT_AOUTHDR_DATA_START
  149. #define PUT_AOUTHDR_DATA_START H_PUT_32
  150. #endif
  151. /* Some fields in the scnhdr are sometimes 64 bits. */
  152. #ifndef GET_SCNHDR_PADDR
  153. #define GET_SCNHDR_PADDR H_GET_32
  154. #endif
  155. #ifndef PUT_SCNHDR_PADDR
  156. #define PUT_SCNHDR_PADDR H_PUT_32
  157. #endif
  158. #ifndef GET_SCNHDR_VADDR
  159. #define GET_SCNHDR_VADDR H_GET_32
  160. #endif
  161. #ifndef PUT_SCNHDR_VADDR
  162. #define PUT_SCNHDR_VADDR H_PUT_32
  163. #endif
  164. #ifndef GET_SCNHDR_SIZE
  165. #define GET_SCNHDR_SIZE H_GET_32
  166. #endif
  167. #ifndef PUT_SCNHDR_SIZE
  168. #define PUT_SCNHDR_SIZE H_PUT_32
  169. #endif
  170. #ifndef GET_SCNHDR_SCNPTR
  171. #define GET_SCNHDR_SCNPTR H_GET_32
  172. #endif
  173. #ifndef PUT_SCNHDR_SCNPTR
  174. #define PUT_SCNHDR_SCNPTR H_PUT_32
  175. #endif
  176. #ifndef GET_SCNHDR_RELPTR
  177. #define GET_SCNHDR_RELPTR H_GET_32
  178. #endif
  179. #ifndef PUT_SCNHDR_RELPTR
  180. #define PUT_SCNHDR_RELPTR H_PUT_32
  181. #endif
  182. #ifndef GET_SCNHDR_LNNOPTR
  183. #define GET_SCNHDR_LNNOPTR H_GET_32
  184. #endif
  185. #ifndef PUT_SCNHDR_LNNOPTR
  186. #define PUT_SCNHDR_LNNOPTR H_PUT_32
  187. #endif
  188. #ifdef COFF_WITH_pex64
  189. #define GET_OPTHDR_IMAGE_BASE H_GET_64
  190. #define PUT_OPTHDR_IMAGE_BASE H_PUT_64
  191. #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
  192. #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
  193. #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
  194. #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
  195. #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
  196. #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
  197. #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
  198. #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
  199. #define GET_PDATA_ENTRY bfd_get_32
  200. #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pex64_bfd_copy_private_bfd_data_common
  201. #define _bfd_XX_bfd_copy_private_section_data _bfd_pex64_bfd_copy_private_section_data
  202. #define _bfd_XX_get_symbol_info _bfd_pex64_get_symbol_info
  203. #define _bfd_XX_only_swap_filehdr_out _bfd_pex64_only_swap_filehdr_out
  204. #define _bfd_XX_print_private_bfd_data_common _bfd_pex64_print_private_bfd_data_common
  205. #define _bfd_XXi_final_link_postscript _bfd_pex64i_final_link_postscript
  206. #define _bfd_XXi_only_swap_filehdr_out _bfd_pex64i_only_swap_filehdr_out
  207. #define _bfd_XXi_swap_aouthdr_in _bfd_pex64i_swap_aouthdr_in
  208. #define _bfd_XXi_swap_aouthdr_out _bfd_pex64i_swap_aouthdr_out
  209. #define _bfd_XXi_swap_aux_in _bfd_pex64i_swap_aux_in
  210. #define _bfd_XXi_swap_aux_out _bfd_pex64i_swap_aux_out
  211. #define _bfd_XXi_swap_lineno_in _bfd_pex64i_swap_lineno_in
  212. #define _bfd_XXi_swap_lineno_out _bfd_pex64i_swap_lineno_out
  213. #define _bfd_XXi_swap_scnhdr_out _bfd_pex64i_swap_scnhdr_out
  214. #define _bfd_XXi_swap_sym_in _bfd_pex64i_swap_sym_in
  215. #define _bfd_XXi_swap_sym_out _bfd_pex64i_swap_sym_out
  216. #define _bfd_XXi_swap_debugdir_in _bfd_pex64i_swap_debugdir_in
  217. #define _bfd_XXi_swap_debugdir_out _bfd_pex64i_swap_debugdir_out
  218. #define _bfd_XXi_write_codeview_record _bfd_pex64i_write_codeview_record
  219. #define _bfd_XXi_slurp_codeview_record _bfd_pex64i_slurp_codeview_record
  220. #elif defined COFF_WITH_pep
  221. #define GET_OPTHDR_IMAGE_BASE H_GET_64
  222. #define PUT_OPTHDR_IMAGE_BASE H_PUT_64
  223. #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
  224. #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
  225. #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
  226. #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
  227. #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
  228. #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
  229. #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
  230. #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
  231. #define GET_PDATA_ENTRY bfd_get_64
  232. #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pep_bfd_copy_private_bfd_data_common
  233. #define _bfd_XX_bfd_copy_private_section_data _bfd_pep_bfd_copy_private_section_data
  234. #define _bfd_XX_get_symbol_info _bfd_pep_get_symbol_info
  235. #define _bfd_XX_only_swap_filehdr_out _bfd_pep_only_swap_filehdr_out
  236. #define _bfd_XX_print_private_bfd_data_common _bfd_pep_print_private_bfd_data_common
  237. #define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript
  238. #define _bfd_XXi_only_swap_filehdr_out _bfd_pepi_only_swap_filehdr_out
  239. #define _bfd_XXi_swap_aouthdr_in _bfd_pepi_swap_aouthdr_in
  240. #define _bfd_XXi_swap_aouthdr_out _bfd_pepi_swap_aouthdr_out
  241. #define _bfd_XXi_swap_aux_in _bfd_pepi_swap_aux_in
  242. #define _bfd_XXi_swap_aux_out _bfd_pepi_swap_aux_out
  243. #define _bfd_XXi_swap_lineno_in _bfd_pepi_swap_lineno_in
  244. #define _bfd_XXi_swap_lineno_out _bfd_pepi_swap_lineno_out
  245. #define _bfd_XXi_swap_scnhdr_out _bfd_pepi_swap_scnhdr_out
  246. #define _bfd_XXi_swap_sym_in _bfd_pepi_swap_sym_in
  247. #define _bfd_XXi_swap_sym_out _bfd_pepi_swap_sym_out
  248. #define _bfd_XXi_swap_debugdir_in _bfd_pepi_swap_debugdir_in
  249. #define _bfd_XXi_swap_debugdir_out _bfd_pepi_swap_debugdir_out
  250. #define _bfd_XXi_write_codeview_record _bfd_pepi_write_codeview_record
  251. #define _bfd_XXi_slurp_codeview_record _bfd_pepi_slurp_codeview_record
  252. #elif defined COFF_WITH_peAArch64
  253. #define GET_OPTHDR_IMAGE_BASE H_GET_64
  254. #define PUT_OPTHDR_IMAGE_BASE H_PUT_64
  255. #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
  256. #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
  257. #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
  258. #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
  259. #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
  260. #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
  261. #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
  262. #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
  263. #define GET_PDATA_ENTRY bfd_get_32
  264. #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_peAArch64_bfd_copy_private_bfd_data_common
  265. #define _bfd_XX_bfd_copy_private_section_data _bfd_peAArch64_bfd_copy_private_section_data
  266. #define _bfd_XX_get_symbol_info _bfd_peAArch64_get_symbol_info
  267. #define _bfd_XX_only_swap_filehdr_out _bfd_peAArch64_only_swap_filehdr_out
  268. #define _bfd_XX_print_private_bfd_data_common _bfd_peAArch64_print_private_bfd_data_common
  269. #define _bfd_XXi_final_link_postscript _bfd_peAArch64i_final_link_postscript
  270. #define _bfd_XXi_only_swap_filehdr_out _bfd_peAArch64i_only_swap_filehdr_out
  271. #define _bfd_XXi_swap_aouthdr_in _bfd_peAArch64i_swap_aouthdr_in
  272. #define _bfd_XXi_swap_aouthdr_out _bfd_peAArch64i_swap_aouthdr_out
  273. #define _bfd_XXi_swap_aux_in _bfd_peAArch64i_swap_aux_in
  274. #define _bfd_XXi_swap_aux_out _bfd_peAArch64i_swap_aux_out
  275. #define _bfd_XXi_swap_lineno_in _bfd_peAArch64i_swap_lineno_in
  276. #define _bfd_XXi_swap_lineno_out _bfd_peAArch64i_swap_lineno_out
  277. #define _bfd_XXi_swap_scnhdr_out _bfd_peAArch64i_swap_scnhdr_out
  278. #define _bfd_XXi_swap_sym_in _bfd_peAArch64i_swap_sym_in
  279. #define _bfd_XXi_swap_sym_out _bfd_peAArch64i_swap_sym_out
  280. #define _bfd_XXi_swap_debugdir_in _bfd_peAArch64i_swap_debugdir_in
  281. #define _bfd_XXi_swap_debugdir_out _bfd_peAArch64i_swap_debugdir_out
  282. #define _bfd_XXi_write_codeview_record _bfd_peAArch64i_write_codeview_record
  283. #define _bfd_XXi_slurp_codeview_record _bfd_peAArch64i_slurp_codeview_record
  284. #else /* !COFF_WITH_pep */
  285. #define GET_OPTHDR_IMAGE_BASE H_GET_32
  286. #define PUT_OPTHDR_IMAGE_BASE H_PUT_32
  287. #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_32
  288. #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_32
  289. #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_32
  290. #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_32
  291. #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_32
  292. #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_32
  293. #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_32
  294. #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_32
  295. #define GET_PDATA_ENTRY bfd_get_32
  296. #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pe_bfd_copy_private_bfd_data_common
  297. #define _bfd_XX_bfd_copy_private_section_data _bfd_pe_bfd_copy_private_section_data
  298. #define _bfd_XX_get_symbol_info _bfd_pe_get_symbol_info
  299. #define _bfd_XX_only_swap_filehdr_out _bfd_pe_only_swap_filehdr_out
  300. #define _bfd_XX_print_private_bfd_data_common _bfd_pe_print_private_bfd_data_common
  301. #define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript
  302. #define _bfd_XXi_only_swap_filehdr_out _bfd_pei_only_swap_filehdr_out
  303. #define _bfd_XXi_swap_aouthdr_in _bfd_pei_swap_aouthdr_in
  304. #define _bfd_XXi_swap_aouthdr_out _bfd_pei_swap_aouthdr_out
  305. #define _bfd_XXi_swap_aux_in _bfd_pei_swap_aux_in
  306. #define _bfd_XXi_swap_aux_out _bfd_pei_swap_aux_out
  307. #define _bfd_XXi_swap_lineno_in _bfd_pei_swap_lineno_in
  308. #define _bfd_XXi_swap_lineno_out _bfd_pei_swap_lineno_out
  309. #define _bfd_XXi_swap_scnhdr_out _bfd_pei_swap_scnhdr_out
  310. #define _bfd_XXi_swap_sym_in _bfd_pei_swap_sym_in
  311. #define _bfd_XXi_swap_sym_out _bfd_pei_swap_sym_out
  312. #define _bfd_XXi_swap_debugdir_in _bfd_pei_swap_debugdir_in
  313. #define _bfd_XXi_swap_debugdir_out _bfd_pei_swap_debugdir_out
  314. #define _bfd_XXi_write_codeview_record _bfd_pei_write_codeview_record
  315. #define _bfd_XXi_slurp_codeview_record _bfd_pei_slurp_codeview_record
  316. #endif /* !COFF_WITH_pep */
  317. /* These functions are architecture dependent, and are in peicode.h:
  318. coff_swap_reloc_in
  319. int coff_swap_reloc_out
  320. coff_swap_filehdr_in
  321. coff_swap_scnhdr_in
  322. pe_mkobject
  323. pe_mkobject_hook */
  324. /* The functions described below are common across all PE/PEI
  325. implementations architecture types, and actually appear in
  326. peigen.c. */
  327. #define coff_swap_sym_in _bfd_XXi_swap_sym_in
  328. #define coff_swap_sym_out _bfd_XXi_swap_sym_out
  329. #define coff_swap_aux_in _bfd_XXi_swap_aux_in
  330. #define coff_swap_aux_out _bfd_XXi_swap_aux_out
  331. #define coff_swap_lineno_in _bfd_XXi_swap_lineno_in
  332. #define coff_swap_lineno_out _bfd_XXi_swap_lineno_out
  333. #define coff_swap_aouthdr_in _bfd_XXi_swap_aouthdr_in
  334. #define coff_swap_aouthdr_out _bfd_XXi_swap_aouthdr_out
  335. #define coff_swap_scnhdr_out _bfd_XXi_swap_scnhdr_out
  336. #ifndef coff_final_link_postscript
  337. #define coff_final_link_postscript _bfd_XXi_final_link_postscript
  338. #endif
  339. void _bfd_XXi_swap_sym_in (bfd *, void *, void *);
  340. unsigned _bfd_XXi_swap_sym_out (bfd *, void *, void *);
  341. void _bfd_XXi_swap_aux_in (bfd *, void *, int, int, int, int, void *);
  342. unsigned _bfd_XXi_swap_aux_out (bfd *, void *, int, int, int, int, void *);
  343. void _bfd_XXi_swap_lineno_in (bfd *, void *, void *);
  344. unsigned _bfd_XXi_swap_lineno_out (bfd *, void *, void *);
  345. void _bfd_XXi_swap_aouthdr_in (bfd *, void *, void *);
  346. unsigned _bfd_XXi_swap_aouthdr_out (bfd *, void *, void *);
  347. unsigned _bfd_XXi_swap_scnhdr_out (bfd *, void *, void *);
  348. bool _bfd_XX_print_private_bfd_data_common (bfd *, void *);
  349. bool _bfd_XX_bfd_copy_private_bfd_data_common (bfd *, bfd *);
  350. void _bfd_XX_get_symbol_info (bfd *, asymbol *, symbol_info *);
  351. bool _bfd_XXi_final_link_postscript (bfd *, struct coff_final_link_info *);
  352. void _bfd_XXi_swap_debugdir_in (bfd *, void *, void *);
  353. unsigned _bfd_XXi_swap_debugdir_out (bfd *, void *, void *);
  354. unsigned _bfd_XXi_write_codeview_record (bfd *, file_ptr, CODEVIEW_INFO *);
  355. CODEVIEW_INFO *_bfd_XXi_slurp_codeview_record
  356. (bfd * abfd, file_ptr where, unsigned long length, CODEVIEW_INFO *cvinfo);
  357. /* The following are needed only for ONE of pe or pei, but don't
  358. otherwise vary; peicode.h fixes up ifdefs but we provide the
  359. prototype. */
  360. unsigned _bfd_XX_only_swap_filehdr_out (bfd *, void *, void *);
  361. unsigned _bfd_XXi_only_swap_filehdr_out (bfd *, void *, void *);
  362. bool _bfd_XX_bfd_copy_private_section_data
  363. (bfd *, asection *, bfd *, asection *);
  364. bool _bfd_pe_print_ce_compressed_pdata (bfd *, void *);
  365. bool _bfd_pe64_print_ce_compressed_pdata (bfd *, void *);
  366. bool _bfd_pex64_print_ce_compressed_pdata (bfd *, void *);
  367. bool _bfd_peAArch64_print_ce_compressed_pdata (bfd *, void *);
  368. bool _bfd_pep_print_ce_compressed_pdata (bfd *, void *);