1f7cc78ecSespie /* Support for the generic parts of PE/PEI; common header information. 2d2201f2fSdrahn Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 35f210c2aSfgsch Free Software Foundation, Inc. 4f7cc78ecSespie Written by Cygnus Solutions. 5f7cc78ecSespie 6f7cc78ecSespie This file is part of BFD, the Binary File Descriptor library. 7f7cc78ecSespie 8f7cc78ecSespie This program is free software; you can redistribute it and/or modify 9f7cc78ecSespie it under the terms of the GNU General Public License as published by 10f7cc78ecSespie the Free Software Foundation; either version 2 of the License, or 11f7cc78ecSespie (at your option) any later version. 12f7cc78ecSespie 13f7cc78ecSespie This program is distributed in the hope that it will be useful, 14f7cc78ecSespie but WITHOUT ANY WARRANTY; without even the implied warranty of 15f7cc78ecSespie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16f7cc78ecSespie GNU General Public License for more details. 17f7cc78ecSespie 18f7cc78ecSespie You should have received a copy of the GNU General Public License 19f7cc78ecSespie along with this program; if not, write to the Free Software 20f7cc78ecSespie Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 21f7cc78ecSespie 22d2201f2fSdrahn /* Most of this hacked by Steve Chamberlain, 23f7cc78ecSespie sac@cygnus.com 24f7cc78ecSespie 25f7cc78ecSespie PE/PEI rearrangement (and code added): Donn Terry 26d2201f2fSdrahn Softway Systems, Inc. */ 27f7cc78ecSespie 28f7cc78ecSespie /* Hey look, some documentation [and in a place you expect to find it]! 29f7cc78ecSespie 30f7cc78ecSespie The main reference for the pei format is "Microsoft Portable Executable 31f7cc78ecSespie and Common Object File Format Specification 4.1". Get it if you need to 32f7cc78ecSespie do some serious hacking on this code. 33f7cc78ecSespie 34f7cc78ecSespie Another reference: 35f7cc78ecSespie "Peering Inside the PE: A Tour of the Win32 Portable Executable 36f7cc78ecSespie File Format", MSJ 1994, Volume 9. 37f7cc78ecSespie 38f7cc78ecSespie The *sole* difference between the pe format and the pei format is that the 39f7cc78ecSespie latter has an MSDOS 2.0 .exe header on the front that prints the message 40f7cc78ecSespie "This app must be run under Windows." (or some such). 41f7cc78ecSespie (FIXME: Whether that statement is *really* true or not is unknown. 42f7cc78ecSespie Are there more subtle differences between pe and pei formats? 43f7cc78ecSespie For now assume there aren't. If you find one, then for God sakes 44f7cc78ecSespie document it here!) 45f7cc78ecSespie 46f7cc78ecSespie The Microsoft docs use the word "image" instead of "executable" because 47f7cc78ecSespie the former can also refer to a DLL (shared library). Confusion can arise 48f7cc78ecSespie because the `i' in `pei' also refers to "image". The `pe' format can 49f7cc78ecSespie also create images (i.e. executables), it's just that to run on a win32 50f7cc78ecSespie system you need to use the pei format. 51f7cc78ecSespie 52f7cc78ecSespie FIXME: Please add more docs here so the next poor fool that has to hack 53f7cc78ecSespie on this code has a chance of getting something accomplished without 54d2201f2fSdrahn wasting too much time. */ 55f7cc78ecSespie 56f7cc78ecSespie #ifndef GET_FCN_LNNOPTR 57f7cc78ecSespie #define GET_FCN_LNNOPTR(abfd, ext) \ 58d2201f2fSdrahn H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) 59f7cc78ecSespie #endif 60f7cc78ecSespie 61f7cc78ecSespie #ifndef GET_FCN_ENDNDX 62f7cc78ecSespie #define GET_FCN_ENDNDX(abfd, ext) \ 63d2201f2fSdrahn H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx) 64f7cc78ecSespie #endif 65f7cc78ecSespie 66f7cc78ecSespie #ifndef PUT_FCN_LNNOPTR 67d2201f2fSdrahn #define PUT_FCN_LNNOPTR(abfd, in, ext) \ 68d2201f2fSdrahn H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) 69f7cc78ecSespie #endif 70f7cc78ecSespie #ifndef PUT_FCN_ENDNDX 71d2201f2fSdrahn #define PUT_FCN_ENDNDX(abfd, in, ext) \ 72d2201f2fSdrahn H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_endndx) 73f7cc78ecSespie #endif 74f7cc78ecSespie #ifndef GET_LNSZ_LNNO 75d2201f2fSdrahn #define GET_LNSZ_LNNO(abfd, ext) \ 76d2201f2fSdrahn H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno) 77f7cc78ecSespie #endif 78f7cc78ecSespie #ifndef GET_LNSZ_SIZE 79d2201f2fSdrahn #define GET_LNSZ_SIZE(abfd, ext) \ 80d2201f2fSdrahn H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_size) 81f7cc78ecSespie #endif 82f7cc78ecSespie #ifndef PUT_LNSZ_LNNO 83d2201f2fSdrahn #define PUT_LNSZ_LNNO(abfd, in, ext) \ 84d2201f2fSdrahn H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_lnno) 85f7cc78ecSespie #endif 86f7cc78ecSespie #ifndef PUT_LNSZ_SIZE 87d2201f2fSdrahn #define PUT_LNSZ_SIZE(abfd, in, ext) \ 88d2201f2fSdrahn H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_size) 89f7cc78ecSespie #endif 90f7cc78ecSespie #ifndef GET_SCN_SCNLEN 91d2201f2fSdrahn #define GET_SCN_SCNLEN(abfd, ext) \ 92d2201f2fSdrahn H_GET_32 (abfd, ext->x_scn.x_scnlen) 93f7cc78ecSespie #endif 94f7cc78ecSespie #ifndef GET_SCN_NRELOC 95d2201f2fSdrahn #define GET_SCN_NRELOC(abfd, ext) \ 96d2201f2fSdrahn H_GET_16 (abfd, ext->x_scn.x_nreloc) 97f7cc78ecSespie #endif 98f7cc78ecSespie #ifndef GET_SCN_NLINNO 99d2201f2fSdrahn #define GET_SCN_NLINNO(abfd, ext) \ 100d2201f2fSdrahn H_GET_16 (abfd, ext->x_scn.x_nlinno) 101f7cc78ecSespie #endif 102f7cc78ecSespie #ifndef PUT_SCN_SCNLEN 103d2201f2fSdrahn #define PUT_SCN_SCNLEN(abfd, in, ext) \ 104d2201f2fSdrahn H_PUT_32(abfd, in, ext->x_scn.x_scnlen) 105f7cc78ecSespie #endif 106f7cc78ecSespie #ifndef PUT_SCN_NRELOC 107d2201f2fSdrahn #define PUT_SCN_NRELOC(abfd, in, ext) \ 108d2201f2fSdrahn H_PUT_16(abfd, in, ext->x_scn.x_nreloc) 109f7cc78ecSespie #endif 110f7cc78ecSespie #ifndef PUT_SCN_NLINNO 111d2201f2fSdrahn #define PUT_SCN_NLINNO(abfd, in, ext) \ 112d2201f2fSdrahn H_PUT_16(abfd,in, ext->x_scn.x_nlinno) 113f7cc78ecSespie #endif 114f7cc78ecSespie #ifndef GET_LINENO_LNNO 115d2201f2fSdrahn #define GET_LINENO_LNNO(abfd, ext) \ 116d2201f2fSdrahn H_GET_16 (abfd, ext->l_lnno); 117f7cc78ecSespie #endif 118f7cc78ecSespie #ifndef PUT_LINENO_LNNO 119d2201f2fSdrahn #define PUT_LINENO_LNNO(abfd, val, ext) \ 120d2201f2fSdrahn H_PUT_16(abfd,val, ext->l_lnno); 121f7cc78ecSespie #endif 122f7cc78ecSespie 123f7cc78ecSespie /* The f_symptr field in the filehdr is sometimes 64 bits. */ 124f7cc78ecSespie #ifndef GET_FILEHDR_SYMPTR 125d2201f2fSdrahn #define GET_FILEHDR_SYMPTR H_GET_32 126f7cc78ecSespie #endif 127f7cc78ecSespie #ifndef PUT_FILEHDR_SYMPTR 128d2201f2fSdrahn #define PUT_FILEHDR_SYMPTR H_PUT_32 129f7cc78ecSespie #endif 130f7cc78ecSespie 131f7cc78ecSespie /* Some fields in the aouthdr are sometimes 64 bits. */ 132f7cc78ecSespie #ifndef GET_AOUTHDR_TSIZE 133d2201f2fSdrahn #define GET_AOUTHDR_TSIZE H_GET_32 134f7cc78ecSespie #endif 135f7cc78ecSespie #ifndef PUT_AOUTHDR_TSIZE 136d2201f2fSdrahn #define PUT_AOUTHDR_TSIZE H_PUT_32 137f7cc78ecSespie #endif 138f7cc78ecSespie #ifndef GET_AOUTHDR_DSIZE 139d2201f2fSdrahn #define GET_AOUTHDR_DSIZE H_GET_32 140f7cc78ecSespie #endif 141f7cc78ecSespie #ifndef PUT_AOUTHDR_DSIZE 142d2201f2fSdrahn #define PUT_AOUTHDR_DSIZE H_PUT_32 143f7cc78ecSespie #endif 144f7cc78ecSespie #ifndef GET_AOUTHDR_BSIZE 145d2201f2fSdrahn #define GET_AOUTHDR_BSIZE H_GET_32 146f7cc78ecSespie #endif 147f7cc78ecSespie #ifndef PUT_AOUTHDR_BSIZE 148d2201f2fSdrahn #define PUT_AOUTHDR_BSIZE H_PUT_32 149f7cc78ecSespie #endif 150f7cc78ecSespie #ifndef GET_AOUTHDR_ENTRY 151d2201f2fSdrahn #define GET_AOUTHDR_ENTRY H_GET_32 152f7cc78ecSespie #endif 153f7cc78ecSespie #ifndef PUT_AOUTHDR_ENTRY 154d2201f2fSdrahn #define PUT_AOUTHDR_ENTRY H_PUT_32 155f7cc78ecSespie #endif 156f7cc78ecSespie #ifndef GET_AOUTHDR_TEXT_START 157d2201f2fSdrahn #define GET_AOUTHDR_TEXT_START H_GET_32 158f7cc78ecSespie #endif 159f7cc78ecSespie #ifndef PUT_AOUTHDR_TEXT_START 160d2201f2fSdrahn #define PUT_AOUTHDR_TEXT_START H_PUT_32 161f7cc78ecSespie #endif 162f7cc78ecSespie #ifndef GET_AOUTHDR_DATA_START 163d2201f2fSdrahn #define GET_AOUTHDR_DATA_START H_GET_32 164f7cc78ecSespie #endif 165f7cc78ecSespie #ifndef PUT_AOUTHDR_DATA_START 166d2201f2fSdrahn #define PUT_AOUTHDR_DATA_START H_PUT_32 167f7cc78ecSespie #endif 168f7cc78ecSespie 169f7cc78ecSespie /* Some fields in the scnhdr are sometimes 64 bits. */ 170f7cc78ecSespie #ifndef GET_SCNHDR_PADDR 171d2201f2fSdrahn #define GET_SCNHDR_PADDR H_GET_32 172f7cc78ecSespie #endif 173f7cc78ecSespie #ifndef PUT_SCNHDR_PADDR 174d2201f2fSdrahn #define PUT_SCNHDR_PADDR H_PUT_32 175f7cc78ecSespie #endif 176f7cc78ecSespie #ifndef GET_SCNHDR_VADDR 177d2201f2fSdrahn #define GET_SCNHDR_VADDR H_GET_32 178f7cc78ecSespie #endif 179f7cc78ecSespie #ifndef PUT_SCNHDR_VADDR 180d2201f2fSdrahn #define PUT_SCNHDR_VADDR H_PUT_32 181f7cc78ecSespie #endif 182f7cc78ecSespie #ifndef GET_SCNHDR_SIZE 183d2201f2fSdrahn #define GET_SCNHDR_SIZE H_GET_32 184f7cc78ecSespie #endif 185f7cc78ecSespie #ifndef PUT_SCNHDR_SIZE 186d2201f2fSdrahn #define PUT_SCNHDR_SIZE H_PUT_32 187f7cc78ecSespie #endif 188f7cc78ecSespie #ifndef GET_SCNHDR_SCNPTR 189d2201f2fSdrahn #define GET_SCNHDR_SCNPTR H_GET_32 190f7cc78ecSespie #endif 191f7cc78ecSespie #ifndef PUT_SCNHDR_SCNPTR 192d2201f2fSdrahn #define PUT_SCNHDR_SCNPTR H_PUT_32 193f7cc78ecSespie #endif 194f7cc78ecSespie #ifndef GET_SCNHDR_RELPTR 195d2201f2fSdrahn #define GET_SCNHDR_RELPTR H_GET_32 196f7cc78ecSespie #endif 197f7cc78ecSespie #ifndef PUT_SCNHDR_RELPTR 198d2201f2fSdrahn #define PUT_SCNHDR_RELPTR H_PUT_32 199f7cc78ecSespie #endif 200f7cc78ecSespie #ifndef GET_SCNHDR_LNNOPTR 201d2201f2fSdrahn #define GET_SCNHDR_LNNOPTR H_GET_32 202f7cc78ecSespie #endif 203f7cc78ecSespie #ifndef PUT_SCNHDR_LNNOPTR 204d2201f2fSdrahn #define PUT_SCNHDR_LNNOPTR H_PUT_32 205f7cc78ecSespie #endif 206f7cc78ecSespie 2075f210c2aSfgsch #ifdef COFF_WITH_pep 2085f210c2aSfgsch 209d2201f2fSdrahn #define GET_OPTHDR_IMAGE_BASE H_GET_64 210d2201f2fSdrahn #define PUT_OPTHDR_IMAGE_BASE H_PUT_64 211d2201f2fSdrahn #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64 212d2201f2fSdrahn #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64 213d2201f2fSdrahn #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64 214d2201f2fSdrahn #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64 215d2201f2fSdrahn #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64 216d2201f2fSdrahn #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64 217d2201f2fSdrahn #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64 218d2201f2fSdrahn #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64 2195f210c2aSfgsch #define GET_PDATA_ENTRY bfd_get_64 2205f210c2aSfgsch 2215f210c2aSfgsch #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pep_bfd_copy_private_bfd_data_common 2225f210c2aSfgsch #define _bfd_XX_bfd_copy_private_section_data _bfd_pep_bfd_copy_private_section_data 2235f210c2aSfgsch #define _bfd_XX_get_symbol_info _bfd_pep_get_symbol_info 2245f210c2aSfgsch #define _bfd_XX_only_swap_filehdr_out _bfd_pep_only_swap_filehdr_out 2255f210c2aSfgsch #define _bfd_XX_print_private_bfd_data_common _bfd_pep_print_private_bfd_data_common 2265f210c2aSfgsch #define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript 2275f210c2aSfgsch #define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript 2285f210c2aSfgsch #define _bfd_XXi_only_swap_filehdr_out _bfd_pepi_only_swap_filehdr_out 2295f210c2aSfgsch #define _bfd_XXi_swap_aouthdr_in _bfd_pepi_swap_aouthdr_in 2305f210c2aSfgsch #define _bfd_XXi_swap_aouthdr_out _bfd_pepi_swap_aouthdr_out 2315f210c2aSfgsch #define _bfd_XXi_swap_aux_in _bfd_pepi_swap_aux_in 2325f210c2aSfgsch #define _bfd_XXi_swap_aux_out _bfd_pepi_swap_aux_out 2335f210c2aSfgsch #define _bfd_XXi_swap_lineno_in _bfd_pepi_swap_lineno_in 2345f210c2aSfgsch #define _bfd_XXi_swap_lineno_out _bfd_pepi_swap_lineno_out 2355f210c2aSfgsch #define _bfd_XXi_swap_scnhdr_out _bfd_pepi_swap_scnhdr_out 2365f210c2aSfgsch #define _bfd_XXi_swap_sym_in _bfd_pepi_swap_sym_in 2375f210c2aSfgsch #define _bfd_XXi_swap_sym_out _bfd_pepi_swap_sym_out 2385f210c2aSfgsch 2395f210c2aSfgsch #else /* !COFF_WITH_pep */ 2405f210c2aSfgsch 241d2201f2fSdrahn #define GET_OPTHDR_IMAGE_BASE H_GET_32 242d2201f2fSdrahn #define PUT_OPTHDR_IMAGE_BASE H_PUT_32 243d2201f2fSdrahn #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_32 244d2201f2fSdrahn #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_32 245d2201f2fSdrahn #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_32 246d2201f2fSdrahn #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_32 247d2201f2fSdrahn #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_32 248d2201f2fSdrahn #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_32 249d2201f2fSdrahn #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_32 250d2201f2fSdrahn #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_32 2515f210c2aSfgsch #define GET_PDATA_ENTRY bfd_get_32 2525f210c2aSfgsch 2535f210c2aSfgsch #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pe_bfd_copy_private_bfd_data_common 2545f210c2aSfgsch #define _bfd_XX_bfd_copy_private_section_data _bfd_pe_bfd_copy_private_section_data 2555f210c2aSfgsch #define _bfd_XX_get_symbol_info _bfd_pe_get_symbol_info 2565f210c2aSfgsch #define _bfd_XX_only_swap_filehdr_out _bfd_pe_only_swap_filehdr_out 2575f210c2aSfgsch #define _bfd_XX_print_private_bfd_data_common _bfd_pe_print_private_bfd_data_common 2585f210c2aSfgsch #define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript 2595f210c2aSfgsch #define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript 2605f210c2aSfgsch #define _bfd_XXi_only_swap_filehdr_out _bfd_pei_only_swap_filehdr_out 2615f210c2aSfgsch #define _bfd_XXi_swap_aouthdr_in _bfd_pei_swap_aouthdr_in 2625f210c2aSfgsch #define _bfd_XXi_swap_aouthdr_out _bfd_pei_swap_aouthdr_out 2635f210c2aSfgsch #define _bfd_XXi_swap_aux_in _bfd_pei_swap_aux_in 2645f210c2aSfgsch #define _bfd_XXi_swap_aux_out _bfd_pei_swap_aux_out 2655f210c2aSfgsch #define _bfd_XXi_swap_lineno_in _bfd_pei_swap_lineno_in 2665f210c2aSfgsch #define _bfd_XXi_swap_lineno_out _bfd_pei_swap_lineno_out 2675f210c2aSfgsch #define _bfd_XXi_swap_scnhdr_out _bfd_pei_swap_scnhdr_out 2685f210c2aSfgsch #define _bfd_XXi_swap_sym_in _bfd_pei_swap_sym_in 2695f210c2aSfgsch #define _bfd_XXi_swap_sym_out _bfd_pei_swap_sym_out 2705f210c2aSfgsch 2715f210c2aSfgsch #endif /* !COFF_WITH_pep */ 2725f210c2aSfgsch 273f7cc78ecSespie /* These functions are architecture dependent, and are in peicode.h: 274f7cc78ecSespie coff_swap_reloc_in 275f7cc78ecSespie int coff_swap_reloc_out 276f7cc78ecSespie coff_swap_filehdr_in 277f7cc78ecSespie coff_swap_scnhdr_in 278f7cc78ecSespie pe_mkobject 279f7cc78ecSespie pe_mkobject_hook */ 280f7cc78ecSespie 281f7cc78ecSespie /* The functions described below are common across all PE/PEI 282f7cc78ecSespie implementations architecture types, and actually appear in 283f7cc78ecSespie peigen.c. */ 284f7cc78ecSespie 2855f210c2aSfgsch void _bfd_XXi_swap_sym_in PARAMS ((bfd*, PTR, PTR)); 2865f210c2aSfgsch #define coff_swap_sym_in _bfd_XXi_swap_sym_in 287f7cc78ecSespie 2885f210c2aSfgsch unsigned int _bfd_XXi_swap_sym_out PARAMS ((bfd*, PTR, PTR)); 2895f210c2aSfgsch #define coff_swap_sym_out _bfd_XXi_swap_sym_out 290f7cc78ecSespie 2915f210c2aSfgsch void _bfd_XXi_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR)); 2925f210c2aSfgsch #define coff_swap_aux_in _bfd_XXi_swap_aux_in 293f7cc78ecSespie 2945f210c2aSfgsch unsigned int _bfd_XXi_swap_aux_out \ 295f7cc78ecSespie PARAMS ((bfd *, PTR, int, int, int, int, PTR)); 2965f210c2aSfgsch #define coff_swap_aux_out _bfd_XXi_swap_aux_out 297f7cc78ecSespie 2985f210c2aSfgsch void _bfd_XXi_swap_lineno_in PARAMS ((bfd*, PTR, PTR)); 2995f210c2aSfgsch #define coff_swap_lineno_in _bfd_XXi_swap_lineno_in 300f7cc78ecSespie 3015f210c2aSfgsch unsigned int _bfd_XXi_swap_lineno_out PARAMS ((bfd*, PTR, PTR)); 3025f210c2aSfgsch #define coff_swap_lineno_out _bfd_XXi_swap_lineno_out 303f7cc78ecSespie 3045f210c2aSfgsch void _bfd_XXi_swap_aouthdr_in PARAMS ((bfd*, PTR, PTR)); 3055f210c2aSfgsch #define coff_swap_aouthdr_in _bfd_XXi_swap_aouthdr_in 306f7cc78ecSespie 3075f210c2aSfgsch unsigned int _bfd_XXi_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR)); 3085f210c2aSfgsch #define coff_swap_aouthdr_out _bfd_XXi_swap_aouthdr_out 309f7cc78ecSespie 3105f210c2aSfgsch unsigned int _bfd_XXi_swap_scnhdr_out PARAMS ((bfd *, PTR, PTR)); 3115f210c2aSfgsch #define coff_swap_scnhdr_out _bfd_XXi_swap_scnhdr_out 312f7cc78ecSespie 313d2201f2fSdrahn bfd_boolean _bfd_XX_print_private_bfd_data_common PARAMS ((bfd *, PTR)); 314f7cc78ecSespie 315d2201f2fSdrahn bfd_boolean _bfd_XX_bfd_copy_private_bfd_data_common PARAMS ((bfd *, bfd *)); 316f7cc78ecSespie 3175f210c2aSfgsch void _bfd_XX_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); 318f7cc78ecSespie 319d2201f2fSdrahn bfd_boolean _bfd_XXi_final_link_postscript 320f7cc78ecSespie PARAMS ((bfd *, struct coff_final_link_info *)); 321f7cc78ecSespie 322f7cc78ecSespie #ifndef coff_final_link_postscript 3235f210c2aSfgsch #define coff_final_link_postscript _bfd_XXi_final_link_postscript 324f7cc78ecSespie #endif 325f7cc78ecSespie /* The following are needed only for ONE of pe or pei, but don't 326f7cc78ecSespie otherwise vary; peicode.h fixes up ifdefs but we provide the 327f7cc78ecSespie prototype. */ 328f7cc78ecSespie 3295f210c2aSfgsch unsigned int _bfd_XX_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR)); 3305f210c2aSfgsch unsigned int _bfd_XXi_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR)); 331d2201f2fSdrahn bfd_boolean _bfd_XX_bfd_copy_private_section_data 332f7cc78ecSespie PARAMS ((bfd *, asection *, bfd *, asection *)); 333d2201f2fSdrahn 334d2201f2fSdrahn /* Macro: Returns true if the bfd is a PE executable as opposed to a PE object file. */ 335*cf2f2c56Smiod #define bfd_pe_executable_p(abfd) \ 336*cf2f2c56Smiod (strncmp ((abfd)->xvec->name, "pei-", 4) == 0 \ 337*cf2f2c56Smiod || strncmp ((abfd)->xvec->name, "efi-app-", 8) == 0) 338